kiat.
thanks for your reply, but theres nothing wrong with the
code. It's been running fine for 2 years, and it runs fine
again after MSExcel is re-installed. I'm sure there's a
dll or something that's getting installed on these PC's or
becoming corrupt, or something like that. I wonder if
anybody can pinpoint that for me?
thanks
joan
-----Original Message-----
I'm not at all sure if this will help, but instead of
New, have you tried
CreateObject? Do a xlApp.Quit before sei it to nothing.
"Joan" wrote in message
...
Excel 97 is being called by a VB program. The behavior
is
this:
Excel opens fine on it's own (from the desktop). But all
of a sudden, on the PC in question, any piece of 'code'
from VB (or event using VBA in MSWord or Access) crashes
with the Error above on the 2nd line of code below:
' Create new hidden instance of Excel.
Set xlApp = New Excel.Application
' Add new workbook to Workbooks collection.
Set wkbNewBook = xlApp.Workbooks.Add
I've read thru all the KB articles and none seem to
apply.
The only way to restore the functionality on the PC is
to
completely unInstall MSExcel, manually removing all the
files associated with it, and then reinstalling. After
the
reinstall of MSExcel the programs all work fine. It
appears that some dll or file is corrupting?
I've tried first just making sure that the MDAC library
was correct, to avoid the uninstall process, and it was
the correct version of MDAC.
It's weird. We have dozens of PCs running the VB
application. And this situation has come up 3 times in
the
past few weeks.
Anybody have a clue?
thanks
Joan
.