Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 1 | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 |
---|---|---|---|---|---|
150 | 2 | 3 | 4 | 5 | 6 |
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
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
Hi,
How would i open my excel file and navigate to the cell i want to paste my table to??
Thanks
andrew