Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with format conversion!!!

Hello everybody! Y need convert a .xls file to .xlsx format. Y have a macro that convert the file but I get an error when opening the file. excel says it is corrupted.

The line of the macro is:

objExcel.ActiveWorkbook.SaveAs(file & ".xlsx"), FileFormat=xlOpenXMLWorkbook

I have Qlikview 11, and Office 2013.

Thank youu!!

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

xlOpenXMLWorkbook has a numeric value in Excel VBA.

VBScript doesn't know that numeric value.

You need to find that numeric value in Excel and use the number in place of xlOpenXMLWorkbook

Try:

objExcel.ActiveWorkbook.SaveAs(file & ".xlsx"),51

View solution in original post

4 Replies
m_woolf
Master II
Master II

That would work in VBA, but VBScript doesn't know the value of xlOpenXMLWorkbook.

You can look up that value in Excel and rewrite the line.

Not applicable
Author

I tried with value of xlWorkbookDefault but it doesn't work. It's the same.

m_woolf
Master II
Master II

xlOpenXMLWorkbook has a numeric value in Excel VBA.

VBScript doesn't know that numeric value.

You need to find that numeric value in Excel and use the number in place of xlOpenXMLWorkbook

Try:

objExcel.ActiveWorkbook.SaveAs(file & ".xlsx"),51

Not applicable
Author

It's work!!! Thank youuuu!!!