Thursday, January 10, 2013

Get Image from Excel- VB Script

I was trying to get the picture from excel and trying to save it in my local HD. But unfortunately I did not aware of some Excel Sheet methods. I googled. Whatever I tried finally I can put the picture into excel. But I did not find the way to take the picture. So  I copied and pasted the 100's of images from my Excel sheet.

After a day later, I have fresh mind. I tried to find a easy way. Finally I got the easiest way. I found the function.

Lotus Script:-

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlwb=xlApp.Workbooks.Open("File Path")
Set xlsheet =xlwb.Worksheets(1)   Call xlSheet.Shapes(0).copy()
    VB Script :-

appExcel = New Excel.Application
xlsBook = appExcel.Workbooks.Open("File Path")
xlsSheet = xlsBook.Worksheets("Sheet1")
Call xlSheet.Shapes(0).copy()
You can get all the images by using for all or far each condition.