Consulting

Results 1 to 4 of 4

Thread: Solved: view all exceptions

  1. #1

    Question Solved: view all exceptions

    I have a VSTO Excel 2010 workbook project, and it works on all PCs except one. The additional custom user control isn't present on the workbook. I've noticed that exceptions in C# are suppressed, and I haven't found where they can be viewed. Is there such thing as Excel error log? How do I turn on all error messages?

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    In VBA, you need an "On Error Goto SomeLabelNameOrNumber" to show error details. Here is how I would do it in VBA.
    [vba]Sub TestErrorRoutine()
    Dim x As Integer, Msg As String
    On Error GoTo ErrMsg

    x = 1 / 0

    GoTo EndNow
    ErrMsg:
    If Err.Number <> 0 Then
    Msg = "Error # " & Str(Err.Number) & " was generated by " _
    & Err.Source & Chr(13) & Err.Description
    MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
    Exit Sub
    End If
    EndNow:
    End Sub[/vba]

  3. #3
    I don't use VBA, I use C#.

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Since this is a VBA forum, then it is not appropriate to discuss C#. I have often found that if I know one language solution, the other language solution will be similar. I don't know of any sites that discuss Excel using C# that have a large user group. More likely you will have to search through standard C# forums.

    While VSTO might be the future, my guess is that most do not use it. I normally use vb.net when working with Microsoft Visual Studio 2010 Express. Chip Pearson has some information about Excel with VSTO and vb.net and some C#. http://www.cpearson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •