Retrieving cell data from Microsoft Excel 98
Retrieving cell data from Microsoft Excel 98
- Subject: Retrieving cell data from Microsoft Excel 98
- From: Robert Castles <email@hidden>
- Date: Tue, 20 Nov 2001 10:17:34 -0600
Hi all,
I'm trying to script some code to retrieve sets of data from an Excel
Spreadsheet. Unfortunately I can't use the "R1C1" since I'm using a repeat
function to access variable row numbers. The Visual Basic code w/i Excel
allows me to do this using the Cells([row number],[column number]) command,
but the Applescript code returns an error that states:
"Microsoft Excel got an error: Can't make some data into the expected type."
The word "Value" is highlighted in the code when this error comes up (in
bold below)
The first column of the reference file is filled with text cells and here's
a piece of the code:
to CountSwatches(dataFile)
local cellValue, excelValue
set cellValue to "start" as text
set rowCount to 1
repeat until cellValue = "end"
tell application "Microsoft Excel"
set cellValue to Value of Cell 1 of Row rowCount of document
dataFile
set rowCount to rowCount + 1
end tell
end repeat
end CountSwatches
I'd appreciate it if anyone has any ideas as to a fix to this error or even
somewhere to refer to on the web.
Thanks,
Bob Castles