Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Please help me
I want to export my dashboard charts into Microsoft word file using Macro.
I went through all the previous discusson.But i am not getting the proper solution.
Can anyone provide me the working Macro for my requirement.
I tried with below Macro Code, i am not getting any error but i am not able to fetch Charts into Microsoft word.
'defining Macro name
sub Export_to_Microsoft_Word
'setting the object as Word and creating the application
set objWord = CreateObject("Word.Application")
objWord.visible = false
set objDoc=objWord.Documents.add
Const wdOrientLandscape = 1
'setting the orientation for MS Word
objDoc.PageSetup.Orientation = wdOrientLandscape
'instructing the Macro to copy the Table object(TB01)
ActiveDocument.GetSheetObject("TB01").CopyTableToClipboard true
objWord.Selection.Paste
'Instructing the Macro to save the file in a particular location
objDoc.SaveAs "D:\EmpSalaryReport"
'instructing the Macro to copy the Chart object(CHO1)
ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard
objWord.Selection.Paste
objDoc.SaveAs "D:\EmpSalaryReport"
end sub
Hi,
I'm not an expert in VB script - can it be that in that second-to-last line where you have a SaveAs procedure, you have to specify a file ending?
I know that is often a source of error in QlikView, so it might be similar here?
Best regards,
DataNibbler
DataNibbler is right you need to specify a valid path with file and file-extension, see also the attachment.