Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
I want to export the bar Graph to Excel
I have used the following code
set obj = ActiveDocument.GetSheetObject("Chart ID")
obj.CopyBitmapToClipBoard
XLSheet.Range("A1").Select
XLDoc.Sheets("Sheet1").Paste
but the problem is it stops at "Copy" Command and worse is Macro does not showed any Error.
try this hope this helps you
Sub ExportGraph()
Dim vSheet
Set XLApp = CreateObject("Excel.Application")
XLApp.Visible = TRUE
Set XLDoc = XLApp.Workbooks.Add
vSheet = ""
vSheet = "Sheet1"
ActiveDocument.GetSheetObject("CH26").CopyBitmapToClipboard 'Copy the charts
XLDoc.Sheets(vSheet).Range("A" & 1).Select
XLDoc.Sheets(vSheet).Paste
Set XLDoc = Nothing
Set XLApp = Nothing
End Sub
It stops "ActiveDocument.GetSheetObject("CH26").CopyBitmapToClipboard " here only
does not showed any error
Hi Avadhoot,
Try this macro to export a bitmap to excel:
Sub ExportBitmap()
Set Doc = ActiveDocument
Set obj = Doc.GetSheetObject("CH27")
Set XLApp = CreateObject("Excel.Application")
XLApp.Visible = True
'Create a new excel worksheet
Set XLDoc = XLApp.Workbooks.Add
obj.CopyBitmapToClipboard
XLDoc.Worksheets(1).Paste
End Sub
Thanks
Mark
No it gives same error...................
Hi Avadhoot,
Try pressing Ctrl+Shift+M and change the module security to the same as the screenshot to see if this solves the problem.
Mark
Nop.... pop up is not viewed
But I updated "Requested module security" and "Current local security" to "System access" and "Allow system access" already....
Hi
Sorry Mark ..
The pop up was thr
n I tried as u said
but its no use..
Did you find in which line error execution failed?
write difference msg box on different lines to find the line of execution failed..
Karthik
Vishwa's macro working simply. Make sure you are changed chart ID correctly
Karthik