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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transferring data from PB to Excel

Status
Not open for further replies.

kayvee33

Programmer
Jul 6, 2005
4
US
I have written a test application to do the above - this application works fine in debug mode but not if I run it without debug mode.

I have a window and a command button and this is the code in the command button. All I am trying to do is open an excel file, write to a cell in the sheet and close the file and excel. If I trace the code in debug mode it works fine. If I run it it does not write - it opens and closes the excel file but the setremote does not seem to be working. Any pointers ?

string s_regiondata[4]
long handle, rtn
run ("N:\Program Files\Microsoft Office\Office10\excel.exe " + "c:\Advances\grade1.xls", Minimized!)
handle = OpenChannel("Excel", "C:\Advances\grade1.XLS")
handle = OpenChannel("Excel", "C:\Advances\grade1.xls")
SetRemote("R1C10", "I", handle)
yield()
rtn = ExecRemote("[Save]", handle)
GetRemote("R1C9", s_regiondata[4], handle)
rtn = ExecRemote("[Close]", handle)
CloseChannel(handle)
rtn = ExecRemote("[quit()]", "Excel", "system")
 
have you tried accessing excel via OLE? this worked fine for me a lot of times...

a programmer is a tool converting coffee into code...
aschi666, sthcomputing.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top