Announcements
Dim objExcel, objWorkbook, objWorksheet, objImage Dim cellRange, imagePath,excelfilepath,sheetname ' Define your variables sheetname="%sheetname%" cellRange = "%CellRange%" ' Change to your desired range imagePath ="%ImageFile%" ' Change to your image file path excelfilepath= "%FilePath%" Set objExcel = CreateObject("Excel.Application") objExcel.Visible = False ' Make Excel visible Set objWorkbook = objExcel.Workbooks.Open(excelfilepath) ' Change the file path Set objWorksheet = objWorkbook.Sheets(sheetname) ' Select the first sheet ' Add the image to the worksheet Set objImage = objWorksheet.Pictures.Insert(imagePath) ' Set the image position based on the specified range objImage.Left = objWorksheet.Range(cellRange).Left objImage.Top = objWorksheet.Range(cellRange).Top ' Resize the image to fit within the specified range objImage.Width = objWorksheet.Range(cellRange).Width objImage.Height = objWorksheet.Range(cellRange).Height ' Save and close workbook objWorkbook.Save objWorkbook.Close objExcel.Quit ' Clean up Set objImage = Nothing Set objWorksheet = Nothing Set objWorkbook = Nothing Set objExcel = Nothing
Thanks & Regards, Nived N
Stay connected: LinkedIn | YouTube | Blogs
Was this answer helpful? If yes, please mark it as the solution by selecting the checkbox in the discussion thread. Your feedback motivates me to keep contributing. Thank you!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Haque 557
Valantis 328
David_MA 264 Super User 2026 Season 1