VBA Code for create object on excel sheet to attached multipal pictures file on another excelsheet

doit_2729

New Member
Joined
Jun 15, 2014
Messages
2
Hello Everyone,

I am not good at VBA coding, i would be grateful if someone would help me.

I would like to create a button for attachment in excel sheet from where i can attached multiple pictures file which will paste on second sheet or " create automatically pictures tab sheet including pictures.

Thanking youVB
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
The code below will attach File into excel sheet. You can put this code in a loop and replace the "Image_File_Path" with actual file name.

Code:
    Thisworkbook.sheets(2).OLEObjects.Add(Filename:= _
        "Image_File_Path", Link:= _
        False, DisplayAsIcon:=True, IconFileName:= _
        "C:\Program Files\Internet Explorer\iexplore.exe", IconIndex:=0, IconLabel _
        :="Image_File_Path").Select
 
Upvote 0
The code below will attach File into excel sheet. You can put this code in a loop and replace the "Image_File_Path" with actual file name.

Code:
    Thisworkbook.sheets(2).OLEObjects.Add(Filename:= _
        "Image_File_Path", Link:= _
        False, DisplayAsIcon:=True, IconFileName:= _
        "C:\Program Files\Internet Explorer\iexplore.exe", IconIndex:=0, IconLabel _
        :="Image_File_Path").Select


Thanks Kumarapush
I dont this is not working for me..either i am doing wrong or i don't know how to do.
i would appreciate if you let me know how to setup

thanks
 
Upvote 0
Upload or mail a Sample Excel file with List of Image Filenames along with its complete path.
I will include a macro to that Excel - to automatically attach those image files to sheet2 through a macro.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top