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

Exporting table to exact cell in Excel

Hi All

I have a straight table in Qlikview which i need to export to a specific cell in excel.

So basically i have a table which looks like this.

Header 1Header 2Header 3Header 4Header 5Header 6
15023

4

56

When i click the export to excel button on the table in Qlikview i want it to open a excel file in a specific location and past just the figures into a specific cell in my excel document (e.g. cell A1 on sheet1 would now contain 150)

I am assuming that it would need to be some sort of a macro.

Any help would be much appreciated

Thanks

Andrew

2 Replies
giakoum
Partner - Master II
Partner - Master II

something like that I guess. instead of creating, you need to change it to opening your excel file and then navigate to the cell you want and then paste :

Sub ExcelExpwCaption

     'Set the path where the excel will be saved

     filePath = "C:\Test.xls"

     'Create the Excel spreadsheet

     Set excelFile = CreateObject("Excel.Application")

     excelFile.Visible = true

     'Create the WorkBook

     Set curWorkBook = excelFile.WorkBooks.Add

     'Create the Sheet

     Set curSheet = curWorkBook.WorkSheets(1)

     'Get the chart we want to export

     Set tableToExport = ActiveDocument.GetSheetObject("CH01")

     Set chartProperties = tableToExport.GetProperties

     tableToExport.CopyTableToClipboard true

     'Get the caption

     chartCaption = tableToExport.GetCaption.Name.v

     'MsgBox chartCaption

     'Set the first cell with the caption

     curSheet.Range("A1") = chartCaption

     'Paste the rest of the chart

     curSheet.Paste curSheet.Range("A2")

     excelFile.Visible = true

     'Save the file and quit excel

     curWorkBook.SaveAs filePath

     curWorkBook.Close

     excelFile.Quit

     'Cleanup

     Set curWorkBook = nothing

     Set excelFile = nothing

End Sub

Not applicable
Author

Hi,

How would i open my excel file and navigate to the cell i want to paste my table to??

Thanks

andrew