I am testing the trial version of Spread8 and trying to import an .xlsx file with no success.
Under Spread7, I first tested the file to see if it is a valid Excel file using the following code…
ExcelTest = Spread1.IsExcelFile(.FileName)
where .filename is the name of the file captured from a dialog box and ExcelTest is defined as an integer. This code worked.
However, when I try the test using the following…
ExcelTest = Spread1.IsExcel2007File(.filename)
the line compiled and seemed to work but the test failed when the file is definitely an .xlsx file.
The documentation indicates that the test statement should actually be…
ExcelTest = Spread1.IsExcel2007File(.filename) as IsExcel2007FileConstants
but when I add the “as IsExcel2007FileConstants” statement at the end of the line by selecting it from the dropdown box then pressing enter, I receive the following error…
Compile error: Expected end of statement
Skipping the Excel test, I tried to open the file using the following statement
First I saved the name of the .xlsx file in the following variable using
XLFile = .FileName
Under Spread7 the code was…
F = Spread1.ImportExcelBook(XLFile,“”)
where F is dimensioned as Boolean
However, under Spread8, the statement I use is
F = Spread1.OpenExcel2007File(XLFile, “”, -1, “”, “”)
but when I execute the code I get the following error
Runtime error 13: Type Mismatch
even though it had been defined as Boolean
What am I doing wrong?