Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write text to specific Excel cells using CASL

Status
Not open for further replies.

cloudstrife11

Programmer
Nov 14, 2008
5
CA
Does anyone know how to specify in excel what cell the 'Write' statement sends strings to?

x = "Some Text"
sFile = "H:\My Documents\ExcelMacro.xls"
Open append sFile as #1
write #1, x
close #1

This will write to cell A1. If the marco is ran again, it will write to A2, and so on.

Does anyone know how to write to cell B1? or C2? or D8?

Thanks
 
You'll want to look at languages more robust than casl to populate excel. There are some good VBA examples in this forum showing how to set up screen objects and manipulate both attatchmate and excel.

Aside from that I'd say the best way to do what your attempting on a limited basis with casl is to write a delimited flat file in the manner your using above then import it in Excel via VBA or wizard.

[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top