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

Microsoft Excel has stopped working

Status
Not open for further replies.

mmogul

IS-IT--Management
Dec 1, 2003
218
US
I have an application that opens excel, reads some data and then closes excel. For one specific user, when the code opens Excel, Excel crashes with the message "Microsoft Excel has stopped working". Any thoughts on where to look to analyze this issue?

Here is the code I use to open / close Excel from Access. I tend to doubt the code is an issue since it works for other users and I have used it successfully for other apps.

Code:
Public Sub OpenCloseExcel(xlAPP As Excel.Application, bOpen As Boolean)
'** When passed a value of True into bOpen, then this sub opens an instance of Excel
'** When passed a value of False into bOpen, then this closes an instance of Excel

Dim xlWB As Excel.Workbook
Dim xlWS As Excel.Worksheet
Dim bExcelWasOpen As Boolean
        
If bOpen Then
        On Error Resume Next
        Set xlAPP = GetObject(, "Excel.Application")
        If Err.Number <> 0 Then
            'Could not get instance, so create a new one
            Err.Clear
            Set xlAPP = CreateObject("Excel.Application")
            bExcelWasOpen = False
            
        Else ' could get open instance
            bExcelWasOpen = True
            
          '** If this is in testmode, then keep excel visible
            If GetTblzAdmin("testmode") Then
                xlAPP.Visible = True
            Else
                xlAPP.Visible = False
            End If
        End If
Else
    xlAPP.Quit
    Set xlAPP = Nothing

End If

End Sub
 
Have you tried stepping through the code on that particular users machine to see which line is killing it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top