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: 
Anonymous
Not applicable

How to export to Excel 2003 mode when Excel 2007 is installed in my computer?

my macro script:

Set objExcelApp = CreateObject("Excel.Application")

Set objExcelDoc = objExcelApp.Workbooks.Add

...

... ...

objExcelDoc.SaveAs vFilePath & "\" & vName

objExcelDoc.Close

The default file type I export is ".xlsx", not ".xls", even if I do as following,

Excel Options-Save-"Save files in this format" and select

"Excel 97-2003 workbook".

Why? How do I export files for Excel 2003?

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

This code is tested:

sXLS = "test.xls"

Set objExcelApp = CreateObject("Excel.Application")
Set objExcelDoc = objExcelApp.Workbooks.Add

set xlSheet = objExcelDoc.Sheets("Sheet1")
xlSheet.Range("A1").value = "hi there"

objExcelDoc.SaveAs sXLS, 56

objExcelDoc.Close

View solution in original post

6 Replies
Anonymous
Not applicable
Author

set obj = ActiveDocument.GetSheetObject("CH01")

obj.ExportBiff "C:\test.xls"

use extension according to your version

Anonymous
Not applicable
Author

Dear sarathi87k,

    

     I will export some tables and charts into 1 sheet in an excel file, so I can not use the function like

ExportBiff .

Anonymous
Not applicable
Author

objExcelDoc.SaveAs vFilePath & "\" & vName

what is Vfilepath & Vname..

m_woolf
Master II
Master II

I googled this:

.ActiveWorkbook.SaveAs(sXLS), 56  'office 2007

.ActiveWorkbook.SaveAs(sXLS), 43  'office 2003

Anonymous
Not applicable
Author

Dear sarathi87k,

     It is file full path, like c:\abc.qvw

Dear mwoolf,

     It runs wrong with your code.

    Set objExcelApp = CreateObject("Excel.Application")

    Set objExcelDoc = objExcelApp.Workbooks.Add

    objExcelDoc.SaveAs(sXLS), 43 vFilePath & "\" & vName

    objExcelDoc.Close

m_woolf
Master II
Master II

This code is tested:

sXLS = "test.xls"

Set objExcelApp = CreateObject("Excel.Application")
Set objExcelDoc = objExcelApp.Workbooks.Add

set xlSheet = objExcelDoc.Sheets("Sheet1")
xlSheet.Range("A1").value = "hi there"

objExcelDoc.SaveAs sXLS, 56

objExcelDoc.Close