Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

Export Macro

Hi all,

for some reason the below code keeps getting stuck at the goto clause

thanks for any help on this guys.

Sub ExportGraph()


Set objWord = CreateObject("Word.Application")

objWord.visible =true

objWord.Documents.open "C:\Users\samuel.brierley\Desktop\External Projects\NRA\NRA_ITS_EMC_Report_Template.docx"

Const wdOrientLandscape = 1


ActiveDocument.GetSheetObject("CH18").CopyBitmapToClipboard




GoTo What:=objWord.wdGoToBookmark, Name:="Equipment_Added"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.PasteSpecial Link:=False, DataType:=wdPasteBitmap, Placement:= _
wdInLine, DisplayAsIcon:=False


end sub

Labels (1)
4 Replies
m_woolf
Master II
Master II

I believe that the only way to use GoTo in vbscript is with error handling:

On Error GoTo What

marcus_sommer

Within qlikview only On Error Resume Next is available.

- Marcus

samuel_brierley
Creator
Creator
Author

That was recorded within word, the idea is to GoTo the bookmark and paste the image there

samuel_brierley
Creator
Creator
Author

This works,

Set objWord = CreateObject("Word.Application")

objWord.visible =true

objWord.Documents.open "C:\Users\samuel.brierley\Desktop\External Projects\NRA\NRA_ITS_EMC_Report_Template.docx"

Const wdOrientLandscape = 1


ActiveDocument.GetSheetObject("CH18").CopyBitmapToClipboard




objWord.wdGoToBookmark "Equipment_Added"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.PasteSpecial Link=False, DataType=wdPasteBitmap, Placement= wdInLine, DisplayAsIcon=False


end sub