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

GETOBJECT error

Status
Not open for further replies.

Agung

Programmer
Joined
Oct 28, 2000
Messages
5
Location
ID
I used GetObject when I want to call Excel program but I got error message "operation unavailable", see my code

oleApp = GETOBJECT(,"Excel.Application")
=AERROR(aerrs)
IF aerrs(1,1) = 1426 && Error Operation unavailable
oleApp = CREATEOBJECT("Excel.Application")
ENDIF

How should I handle the ERROR ?

Thanks


 
Hi!

ON ERROR nErrorNumber=error()
nErrorNumber = 0

&& try it
oleApp = GETOBJECT(,"Excel.Application")

if nErrorNumber > 0 && error happened
if nErrorNumber = 1426
...
endif
endif
ON ERROR && switch off error handling, or remember ON("ERROR") and restore it here


Hope this helps.
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top