Hi,
I'm trying to scan through an open Excel-document with MapBasic and collect a range of values from a specific column to be used in MapBasic, but the only way I seem to get it work is cell by cell by assigning each DDERequest$ with single row & column numbers (see the commented lines below).
What I do need is to get the DDERequest$ working in a loop where I scan through several rows of the same column. I'm jammed with this code that keeps on complaining about the run command "..." - it doesn't seem to assign any value to the cell variable. The print-commands output of the string "cell = ..." Looks OK to me...
I've started to wonder whether there are limitations in using variable names combined with the "run command"?
- - -
Dim chan_num, i, nro As Integer
Dim cell As String
OnError GoTo no_connection
chan_num = DDEInitiate("EXCEL", "Report 1")
OnError GoTo 0
' cell = DDERequest$( chan_num, "R7C2" )
' print cell
for i = 1 to 100
print "cell = DDERequest$( "+chan_num+", ""R"+(6+i)+"C5"" )"
run command "cell = DDERequest$( "+chan_num+", ""R"+(6+i)+"C5"" )"
print cell
next
DDETerminateAll
End Program
no_connection :
Note "ERROR! Excel not open!"
End Program
- - -
One possibility of course would be to import the excel-document to MapInfo, but since I've learned that it's possible to read the excel-document directly I thought I'd give this a try. Any ideas anybody?
I'm using MapInfo 7.5 and MapBasic 5.5 - and yes I know - I should upgrade - working on that too :)
_\////
(o o)
- - - - - - - - -ooOO -(__) -OOoo - - - - - - - - - - -
YTV - Pääkaupunkiseudun yhteistyövaltuuskunta
http://www.ytv.fi
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Markku Huotari YTV, liikenneosasto
[EMAIL PROTECTED] Tietotekniset palvelut
www.geocities.com/houtari Opastinsilta 6 A
puh. (09) 156 1219 00520 HELSINKI
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
_______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
