I have a macro that does not have any issues until it hits the following module that I have used many times before.
The program does everything it was intended to do and emails the completed document to the next person. Then it closes the workbook using the following code.
Unlike every other program I have written with this code, the user gets the message, "Excel has stopped working." The only difference is that this follows an Outlook function that sends this 1 meg file. I am wondering if it is waiting for Outlook to send the file? The users told me they had other Excel workbooks open when they got the error, does that have something to do with it?
I cannot reproduce the error so any suggestion will be appreciated!
The program does everything it was intended to do and emails the completed document to the next person. Then it closes the workbook using the following code.
Code:
Public Function CloseWorkbook(wb As String)
Application.DisplayAlerts = False
Workbooks(wb).Close
Application.DisplayAlerts = True
End Function
Unlike every other program I have written with this code, the user gets the message, "Excel has stopped working." The only difference is that this follows an Outlook function that sends this 1 meg file. I am wondering if it is waiting for Outlook to send the file? The users told me they had other Excel workbooks open when they got the error, does that have something to do with it?
I cannot reproduce the error so any suggestion will be appreciated!