Quantcast
Viewing all articles
Browse latest Browse all 2638

Re: How to export graph into excel

Hi Yow,

 

you can't open a wmf file in excel with workbooks.open(). You have to import the image file into a worksheet.

 

Not tested example: (creates a new workbook and inserts the image)

 

lole_excel = CREATE OLEObject

lole_excel.ConnectToNewObject( "excel.application" )

lole_excel.visible = true

lole_excel.workbooks.add()

lole_sheet = lole_excel.ActiveSheet

dw_1.SaveAs('C:\.....reports\Graph.wmf',wmf!,TRUE)

lole_sheet.Shapes.addPicture("C:\.....reports\Graph.wmf", 0, -1, left, right, width, height)

 

 

see excel vba documentation for more information


Viewing all articles
Browse latest Browse all 2638

Trending Articles