Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Excel or VB problem?

nakecnakec Member Posts: 16
hi all, I'm not sure if this is the correct section to post this question.

All I want to do is create a worksheet in Excel with 100 cells which will be initially resized and occupied by 100 .jpg images. The images should be linked, not embedded, since i want to have all 100 images in a file on the c: drive, which I will update with new images. Whenever I open the excel worksheet, it should read all 100 images from the c: file and display them in the worksheet. Maybe it would be nice to have a command button directly in the worksheet with "update". I'm having problems with how to insert these images into each cell so that they are linked to the source file on c:. Do I have to write a short VB program to open a worksheet and insert the images into the worksheet? Any help will be appreciated. Thanks,
Tom

Comments

  • dokken2dokken2 Member Posts: 532
    : hi all, I'm not sure if this is the correct section to post this
    : question.
    :
    : All I want to do is create a worksheet in Excel with 100 cells which
    : will be initially resized and occupied by 100 .jpg images. The
    : images should be linked, not embedded, since i want to have all 100
    : images in a file on the c: drive, which I will update with new
    : images. Whenever I open the excel worksheet, it should read all 100
    : images from the c: file and display them in the worksheet. Maybe it
    : would be nice to have a command button directly in the worksheet
    : with "update". I'm having problems with how to insert these images
    : into each cell so that they are linked to the source file on c:. Do
    : I have to write a short VB program to open a worksheet and insert
    : the images into the worksheet? Any help will be appreciated. Thanks,
    : Tom

    one suggestion, create a macro and record the steps for inserting the object link to your jpg. then you can modify the macro's vba code to traverse through a range of cells and jpg filenames.

    sample code that excel writes-

    Range("B1").Select
    ActiveSheet.OLEObjects.Add(Filename:="D:1.JPG", Link:=True, DisplayAsIcon _
    :=False).Select
    Selection.ShapeRange.ScaleWidth 0.1, msoFalse, msoScaleFromTopLeft
    Selection.ShapeRange.ScaleHeight 0.09, msoFalse, msoScaleFromTopLeft


    then you need to update the "B1" cell selection and the filenames
Sign In or Register to comment.