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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

macro for copying image to clipboard

I cant to copy all the active tables and charts in QVW file to Clipboard. What will be the Macro for this ??

1 Reply
Sokkorn
Master
Master

Hi,

What the output you want to paste? Something like PDF or Excel.

Another one you can looking into <Reports> in tools bar and then add those object into your report. By the way let try this sample macro for copy object into Excel below:

SUB SendExcel()
       'ActiveDocument.Reload
       SET tmpFileName =ActiveDocument.Variables("vFileName") 'Create one varaible vFileName = DATE(NOW(),'YYYYMMDD') & '_ProjectStatus.xlsx'
       FileName =tmpFileName.GetContent.STRING
      
       SET XLApp =CreateObject("Excel.Application")
       XLApp.Visible = FALSE
       SET XLDoc = XLApp.Workbooks.Add

       XLDoc.Sheets(1).name ="TestExport"
       SET XLSheet = XLDoc.Worksheets(1)
       SET MyTable =ActiveDocument.GetSheetObject("CH01")
       SET XLSheet = XLDoc.Worksheets(1)
       MyTable.CopyTableToClipboard TRUE
       XLSheet.PasteXLSheet.Range("A1")
       XLDoc.SaveAs "C:\" &FileName

       XLApp.Visible = FALSE

       XLApp.Quit
       Set XLApp = Nothing
       Set Table = Nothing
       ActiveDocument.Save
       'ActiveDocument.GetApplication.Quit
End Sub