Discussion Board for collaboration related to QlikView App Development.
Trying to export customer number from a table into excel. If use the XL button they remain as text but if I use a macro these turn to a number and drop the leading zero. If was only 1 table I would use the XL button but there is 20 tables and is time consuming.
Has anyone any ideas on what I can add to the macro to keep table as text?
Thank you for help in advance
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = True
set XLDoc = XLApp.Workbooks.Add
Set xlSheet = xlDoc.Worksheets("Sheet1")
set obj = ActiveDocument.getsheetobject("CH199")
XLApp.Sheets("Sheet1").Name = "customer"
|Customer No||Customer Name||Telephone1||Telephone 2||Total Sale||Total Qty|
this should work:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.DisplayAlerts = True
Set xlDoc = objExcel.Workbooks.Add
Set xlSheet = xlDoc.Worksheets("Tabelle1")
set obj = ActiveDocument.GetSheetObject("TB01")
xlDoc.WorkSheets("Tabelle1").Range("D:E").EntireColumn.NumberFormat = "@"
see attached file
hope this helps
Thank you Frank for your response
My object is a chart rather and a table as Total Sales and Qty is a calculation, but will see if I can change this somehow to let me use a chart instead. But if you have any further guidance would greatly appreciate it
Example works great for the sample data that I had above. Thank you