Excel function error
Moderators: JRL, Dorian (MJT support)
Excel function error
Hi everyone, I am simply trying to get data from an Excel file and can't seem to get anything.
XLSheetToArray>C:\Macro Scheduler\Test\data\Test.xlsx,TestData,sheetArray
Wait>2
ArrayCount>sheetArray,numrows
MessageModal>%numrows%
This script does not go past the first line.
I've checked the file and path, they are correct. Every time I run this script I get a "File is not an Excel" error
Any idea what's going on?
Thanks
XLSheetToArray>C:\Macro Scheduler\Test\data\Test.xlsx,TestData,sheetArray
Wait>2
ArrayCount>sheetArray,numrows
MessageModal>%numrows%
This script does not go past the first line.
I've checked the file and path, they are correct. Every time I run this script I get a "File is not an Excel" error
Any idea what's going on?
Thanks
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
Use the Code Builder to get the path.
Right click XLSheetToArray and select Code Builder. Then Browse to file.
(We all make typos.)
Did you put double quotes around the path? <- DON'T
(Old habits die slowly)
Right click the Excel page tab, select Rename and then copy the exact name.
(and some of us still make typos...)
If these don't fix it, hopefully someone else can offer assistance.
Right click XLSheetToArray and select Code Builder. Then Browse to file.
(We all make typos.)
Did you put double quotes around the path? <- DON'T
(Old habits die slowly)
Right click the Excel page tab, select Rename and then copy the exact name.
(and some of us still make typos...)
If these don't fix it, hopefully someone else can offer assistance.
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
I see the same "File is not an Excel file" error as layzzer. Converted the file to a .xls and XLSheetToArray> now works. Tried on Win XP and Win 7 with the same results.
My xlsx file was created using Excel 2007. Perhaps a newer version of Excel creates a .xlsx file that is compatible with XLSheetToArray>?
One other point. Discovered that the sheet name parameter is case sensitive.
Just found a copy of Excel 2010 and saved the file to an xlsx format and get the same "File is not an Excel file" error.
Simply renaming the file from .xlsx to .xls does not fix the issue. It appears the file must be saved in the .xls format for XLSheetToArray> to work.
My xlsx file was created using Excel 2007. Perhaps a newer version of Excel creates a .xlsx file that is compatible with XLSheetToArray>?
One other point. Discovered that the sheet name parameter is case sensitive.
Just found a copy of Excel 2010 and saved the file to an xlsx format and get the same "File is not an Excel file" error.
Simply renaming the file from .xlsx to .xls does not fix the issue. It appears the file must be saved in the .xls format for XLSheetToArray> to work.
So I don't know if help is incorrect and the function cannot read from a .xlsx file or if the function is meeting a "degree of compatibility" and somewhere there is a .xlsx file that it can read from... just not the ones we've tried.Help for [color=green]XLSheetToArray[/color]> wrote:Imports a sheet from an Excel file (.xls or .xlsx) into an array. Note that this function differs from the other XL functions in that it does NOT require Excel to be installed and instead reads the Excel file directly. Therefore the same degree of compatibility cannot be guaranteed.
In any case glad you have a resolution. Hope it works for you.