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!

Excel Hangs - Ideas?

Status
Not open for further replies.

RoguePoet01

Programmer
Joined
Oct 1, 2003
Messages
302
Location
US
Hi,

I've got a program that runs in the background and writes two XL spreadsheets then e-mails them to people.

The problem is that after the program runs, it hangs up XL so that when one of the e-mailed Excel files is opened from Outlook, you can't see the file.

I've made sure to close the application and "Set XLApp = Nothing", but it still keeps getting hung up.

Any ideas?
 
is there anyway to clear the memory from our apps?
 
ToshTrent,

Yes. Handling the errors appropriately should do the job. Assuming that normal termination deletes the objects, closes files, and so on.

Vladk
 
You could kill the process if you know which one it is...



AGIMA - professional web hosting is our business.

AGIMA Computing
 
vladk,

"Handling the errors appropriately should do the job."

That's a good point. I was trapping errors in my VB program, but this particular error or "anamoly" was on the Excel side, and no error code was generated.

Sub ProcessXL()

On Error Goto ErrorExecute

....

Exit Sub
ErrorExecute:
If cn.State = adStateOpen Then ErrCase = 3
Call ErrorLog
Response = MsgBox("Error in the 'ProcessXL' subroutine.", vbCritical, "Error")
End
End Sub
 
RoguePoet01,

I am not sure of how you handled the errors in VBA inside Excel.
That handling should in theory report the problems in Excel and at least alert about the possible implications.

Vladk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top