Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table in sheet1 and a chart in sheet2, and I want to use marco to export those 2 objects to 2 bitmap files.
I can only export the object in the active sheet but not the other sheet.
I tried to activate the sheet before export but it doesn't work
there is my code:
ActiveDocument.ActivateSheet 0
ActiveDocument.GetApplication.Refresh()
set myChart = ActiveDocument.GetSheetObject("CH01")
myChart.ExportBitmapToFile "C:\tempBMP1.bmp"
ActiveDocument.ActivateSheet 1
ActiveDocument.GetApplication.Refresh()
set myChart = ActiveDocument.GetSheetObject("CH02")
myChart.ExportBitmapToFile "C:\tempBMP2.bmp"
set myChart = nothing
Any idea? thanks!
Try adding
ActiveDocument.GetApplication.WaitForIdle
before and after the exports.
-Rob
Try adding
ActiveDocument.GetApplication.WaitForIdle
before and after the exports.
-Rob
It's work now! thanks a lot!