Run-time error 4599 (Excel to Word)

P

Peter

What is going wrong here ? I couldn't transfer my data from Excel to Word
table beacuse of error
--> Run-Time 4599 Process failed in other application.
Below is my VBA Procedure. I signed the error problem with <----:


Public Sub getRowNo() 'gets the number of records in the Excel file
Rowstr = "abc" 'initialise variable with dummy value
pos = 1
itemstr = "R" + LTrim(str(pos)) + "C1"
Chan = DDEInitiate(App:="Excel", Topic:="System")
DDEExecute Channel:=Chan, Command:="[OPEN(" & Chr(34) & ActiveDocument.Path
+ "\students.xls" & Chr(34) & ")]"
DDETerminate Channel:=Chan
Chan = DDEInitiate(App:="Excel", Topic:="students.xls")
While Len(Rowstr) > 1 ' if the cell has data
Rowstr = DDERequest(Channel:=Chan, Item:=itemstr) <----- Here I get this
error -------->
pos = pos + 1 'counting the number of filled cells
itemstr = "R" + LTrim(str(pos)) + "C1"
Wend
DDETerminateAll
pos = pos - 1 'need to go back one number
End Sub

Has anyone idea how to resolve it ?
Thanks
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top