Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Com Interop Errorcode

Hi,

where can I find the meaning of the error code that retun from the com interop

Regards,
Raja
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Com Interop Errorcode

In your procedure's error handling, put something like...

Debug.Print err.number & " - " & Err.Description

or

Msgbox err.number & " - " & Err.Description

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Raja" wrote:

Hi,

where can I find the meaning of the error code that retun from the com interop

Regards,
Raja

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Com Interop Errorcode

Yes, I know that. I mean what the number means? where I can find a list
of all numbers?

For exmaple, the Workbook.Open method could throw exception when you try to
open a workbook that already opened. Excel display to use a message say "Do
you want to update.....". and if the user click No, Open method throw
exception with number. and I interested to see all possible error that the
open method could throw?

Regards,
Raja

"Gary Brown" wrote:

In your procedure's error handling, put something like...

Debug.Print err.number & " - " & Err.Description

or

Msgbox err.number & " - " & Err.Description

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Raja" wrote:

Hi,

where can I find the meaning of the error code that retun from the com interop

Regards,
Raja

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Com Interop Errorcode

I don't know about a list of ONLY errors produced when opening a workbook but
the following procedure [ErrorList] will list all error messages that VBA
Excel throws. If a number is not listed, the Description is
'Application-defined or object-defined error'.

'/==============================================/
Public Sub ErrorList()
'create list of all errors with descriptions from
' Active Cell down
Dim i As Long, iMax As Long, x As Long
Dim varAnswer As Variant

On Error GoTo err_Sub

iMax = 5000

varAnswer = _
MsgBox("The process will list errors and descriptions." _
& vbCr & vbCr & "Any errors with the description " _
& vbCr & "'Application-defined or " & _
"object-defined error' will not be included in the list." _
& vbCr & vbCr & _
"All cells below the Active cell will be erased." & _
vbCr & vbCr & "Continue?", _
vbCritical + vbYesNo + vbDefaultButton2, _
"Create Error Listing...")

If varAnswer = vbYes Then
On Error Resume Next
ActiveCell.Offset(x, 0).value = "Err.Number"
ActiveCell.Offset(x, 1).value = "Err.Description"

For i = 1 To iMax
Err.Clear
Err.Raise i
If Len(Err.Description) < 0 And _
Err.Description < _
"Application-defined or object-defined error" Then
x = x + 1
ActiveCell.Offset(x, 0).value = Err.Number
ActiveCell.Offset(x, 1).value = Err.Description
End If
Err.Clear
Next i
End If

On Error GoTo err_Sub
Err.Clear

Cells.EntireColumn.AutoFit
ActiveCell.Offset(1, 0).Activate
ActiveWindow.FreezePanes = False
ActiveWindow.FreezePanes = True
ActiveWindow.Zoom = 75

exit_Sub:
Exit Sub

err_Sub:
GoTo exit_Sub
End Sub
'/==============================================/


--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Raja" wrote:

Yes, I know that. I mean what the number means? where I can find a list
of all numbers?

For exmaple, the Workbook.Open method could throw exception when you try to
open a workbook that already opened. Excel display to use a message say "Do
you want to update.....". and if the user click No, Open method throw
exception with number. and I interested to see all possible error that the
open method could throw?

Regards,
Raja

"Gary Brown" wrote:

In your procedure's error handling, put something like...

Debug.Print err.number & " - " & Err.Description

or

Msgbox err.number & " - " & Err.Description

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Raja" wrote:

Hi,

where can I find the meaning of the error code that retun from the com interop

Regards,
Raja

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interop Excel thejamie Excel Programming 2 March 24th 08 11:41 AM
.Net via COM Interop in VBA Jimmah Excel Programming 0 July 5th 07 05:12 PM
Excel interop from c# Velislav Excel Programming 3 February 15th 07 07:39 AM
vb.net interop Cell truncation in vb.net interop Excel Programming 1 November 23rd 06 07:23 PM
errorcode if somebody is trying to change ... Martin Bauer Excel Programming 1 April 14th 06 12:40 PM


All times are GMT +1. The time now is 02:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"