Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Error code information?

Hi all,
Does anyone know of a good book or web site that has a list of all VB-6 error codes with a good description of what each one means? I tried a "Google" search of one code I am getting but there was nothing there that explained the code. I also don't want to have to bug people on the forum and then wait for a reply every time I get a code that I don't understand.
Thanks, Garner
[410 byte] By [Garner] at [2007-11-11 8:35:35]
# 1 Re: Error code information?
The definitive list of error codes is on MSDN: http://msdn.microsoft.com/library/en-us/vbenlr98/html/vamsgtrappableerrors.asp . You will likely, however, need to Google or post a forum message to get detailed information about how to correct specific errors.
Phil Weber at 2007-11-11 17:25:18 >
# 2 Re: Error code information?
Hi Phil,
Thanks for the great link!!! Tons of information!
Now I have a new problem. I spent almost an hour going over the information in that link and still didn't find what I needed. May be I asked for the wrong thing? I got an error code ( #1004 Method 'Cell's of Object.' Global' Failed )
I couldn't find any information on this error code at the link that you provided or in any of the books that I have.
Why Me? Thanks again, Garner
Garner at 2007-11-11 17:26:18 >
# 3 Re: Error code information?
Could you identify where in your code the error occurs?
pclement at 2007-11-11 17:27:19 >
# 4 Re: Error code information?
That's not a Visual Basic error, it's an Excel error. See if this helps: http://msdn.microsoft.com/archive/en-us/office97/html/web/004.asp
Phil Weber at 2007-11-11 17:28:24 >
# 5 Re: Error code information?
Hi all,
Phil is quite right! I was trying to use my code to open EXCEL when the error occured. I'll try the site that you sugested.

Paul, this is the code where the error occurs:

Private Sub lbl034_Click()
Set AppExcel = CreateObject("Excel.Application")
AppExcel.Workbooks.Open FileName:="g:\tmp\book11.xls"

Cells.Find(What:="34034b", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
'Highlights the entire row.
If IsEmpty(ActiveCell) Then Exit Sub

On Error Resume Next
If IsEmpty(ActiveCell.Offset(0, -1)) Then Set LeftCell = ActiveCell Else Set LeftCell = ActiveCell.End(xlToLeft)
If IsEmpty(ActiveCell.Offset(0, 1)) Then Set RightCell = ActiveCell Else Set RightCell = ActiveCell.End(xlToRight)
Range(LeftCell, RightCell).Select

AppExcel.Visible = True
End Sub

For more information on this problem please see, "Open and close EXCEL with VB6" posted 4-26-06. Several people have tried to help but nothing seems to be working.

Thanks to all, Garner
Garner at 2007-11-11 17:29:23 >
# 6 Re: Error code information?
Have you tried specifying the Worksheet object for the Cells you are searching?
pclement at 2007-11-11 17:30:21 >
# 7 Re: Error code information?
Yes. When I run the program the code that I use is:
AppExcel.Workbooks.Open FileName:="D:\K and D (152598).xls"
If I try to use the "g:\temp" code I get an error that the file cannot be found. Please see "Open and close Excel with VB6" posted 4-26-06 for ongoing details and help suggested from others. It may explain the situation better without pasting all of the details over to this thread and using up more forum space.
Thank you, Garner
Garner at 2007-11-11 17:31:25 >
# 8 Re: Error code information?
OK, well now you're describing two different problems and it's getting a little confusing. Let's take this one issue at a time. What is the first problem you are encountering and please identity the line of code where the problem occurs.
pclement at 2007-11-11 17:32:25 >
# 9 Re: Error code information?
Paul,
Yes, this is confusing. Would it work better this way? To stay with the title of this thread, "Error code information", I'll only ask about that here.

When I get an error code I can usually fix the problem if I know what the code means. I have some books that I can look up some of the codes and there is a definition of what would cause that error. Problem is, I have to search through 3 books about programming to find a code definition scattered among the programming instructions. I was hoping that someone knew of a book or books that only contained error code information arranged in a searchable format. Even if I had to buy seperate books, one for VB6, one for Excel, and one for VBA.

I will post more information on the programming problem under the thread "Open and close Excel with VB6" unless you instruct me to put that information here.

Thank you, Garner
Garner at 2007-11-11 17:33:22 >
# 10 Re: Error code information?
Probably better to solve one problem at a time. So I'll try and go back to my previous question, which was related to resolving the "#1004 Method 'Cell's of Object.' Global' Failed" error. Have you tried the following:

WorksheetName.Cells.Find(What:="34034b", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

All that I've done in the above code is add the Worksheet name, which of course you would change to whatever the name of your Worksheet is.
pclement at 2007-11-11 17:34:23 >
# 11 Re: Error code information?
At the risk of sounding really stupid I will tell you that I don't know the name of the worksheet. I opened the "Excel" file that contains my information, clicked Format & then Rename. "Sheet1" was highlighted for renaming. I assumed that "Sheet1" must be it's name? I tried:

Sheet1.Cells.Find(What:="34034b", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

This generated an "Object Required" error so now I'm guessing that "Sheet1" is not the name of the worksheet? Now I'm totally lost and confused!
Garner at 2007-11-11 17:35:34 >
# 12 Re: Error code information?
You can try using the ActiveSheet object if you do not know the name of the Worksheet. You can also use the Worksheets collection to point to the same object:

Worksheets.Item(ActiveSheet.Name)
pclement at 2007-11-11 17:36:32 >
# 13 Re: Error code information?
Hi again Paul,
I tried everything that you suggested and still the same results. :confused: I am looking over my original code trying to figure out why it will work perfectly the first time and then clicking the exact same label, which should use the exact same code, produces something different. I will post this code in the thread "open and close Excel with VB6" since we are way off the topic of "error code information" which this thread is about.
Thanks for all of the help, Garner
Garner at 2007-11-11 17:37:27 >