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!

run time error 429 getobject 1

Status
Not open for further replies.

basicyen

IS-IT--Management
Oct 4, 2002
15
US
I am writting very basic program which resulting run time error 429.

Dim objExcel as Object
set objExcel = GetObject(, "Excel.Application")

Though some suggested to use errorHandler,this does not really solve the problems;

Some suggested missing/corrupt .DLL. and I don't know which DLL files to be registered. Does anybody know which DLL???

MicrosoftTech final suggestion is to reisntall office suite 97. Which I have not tried. Is this the right way to solve "all problems" related to 429 error??

Any help is very much appreciated
Thanks




 

GetObject only returns a reference to an object if, in fact, an instance of the object is currently running. If Excel is not running when you execute your statement, then Error 429 will occur. Use CreateObject() to force a new instance each time. Or, as someone has already suggested to you, use the error handler to determine whether to use CreateObject after the call to GetObject:

Dim blnExcelRunning As Boolean
Dim xlApp As Excel.Application

On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
If Err.Number > 0 Then
blnExcelRunning = False
Else
blnExcelRunning = True
End If
Err.Clear
On Error GoTo err_handler
If Not blnExcelRunning Then
Set xlApp = CreateObject("Excel.Application")
End If
xlApp.Visible = True
err_exit:
Exit Sub
err_handler:
Resume err_exit

Mark
 
Marksweetland... your replied to "Run time error 429" is
very complete, absolutely academic and very helpful. I really appreciate your kind heart. I owe you much. And also Much thanks to Tek-Tips which I found it by accident through google.

Does anybody know of VisualBasic clubs meeting around Los Angeles county or nearby Los Angeles County.???
I would appreciate for any info about it.

Thanks
yeno




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top