I have a excel report which connects to the database and pull data once I click on to "GO" button which I created as part of that excel report. Interesting part is the program generates reports fine on the following machine.
i) Windows OS XP 2002 SP2 running Excel version of 2002 SP3
It gives following error when I try to run the same report on a machine with Windows OS XP 2002 SP2 running Excel version of 2003 with SP1.
Error message :-
Error # 1004 was generated by Microsoft Office Excel
General ODBC Error
Context: 1001004 File: C:\Program Files\Microsoft office\OFFICE11\1033\xlmain11.chm.
I tried to look at the xlmain11.chm file, that file is nothing but microsoft excel file.
I would appreciate if somebody can point me in right direction of why this error is poping out on the different machine. Only difference between those machines is the Office version i.e 2002 vs 2003, I don't get it because it is running fine on office 2002 but not on office 2003.
Hello johnson,
You didn't mention which database you are connecting to. It could be the ODBC connection string format changed, or some parameter that was optional in 2002 is now required in 2003. I don't have 2002 to compare with 2003, so I can't say for sure this is the problem, but it is where I would start to look.
Sincerely,
Leith Ross
I tried to disect the visual basic code in the macro. I think it is trying to fail in this section (code given below). We are using informix database and informix ODBC connection to connect to database.
Note :- following O.S with office combination works okay with
a) Windows X.P 2002 O.S with Office Excel 2002 SP3.
b) Windows X.P 2002 SP2 O.S with Office Excel 2003.
But it doesnt work with following O.S with office combination.
a) Windows X.P 2003 SP1 with office Excel 2002 SP2.
Following is the section of the code I think 80% it is erroring out :-
The problem is this macro was created in old version of office and not running on latest version of office. When I try to click on to help when it pops out error. I see following list of things it is asking me to check in macro errorCode:With wksTemplate.QueryTables(1) .Connection = "ODBC;DSN=claim" ' .Connection = cnctStr .CommandType = xlCmdSql .CommandText = cmd .Destination = Range("A5") .AdjustColumnWidth = False .BackgroundQuery = False .EnableEditing = False .EnableRefresh = True .FieldNames = False .FillAdjacentFormulas = True .PreserveColumnInfo = True .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .RowNumbers = False .SavePassword = True .SaveData = True .RefreshPeriod = 0 .Refresh BackgroundQuery:=False If .Refreshing Then MsgBox "Query is currently refreshing: please wait" Else .Refresh BackgroundQuery:=False End If
There is an error in the macro you were running. The specified method can't be used on the specified object for one of the following reasons:
a) An argument contains a value that is not valid
b) The method can't be used in the applied context. Specifically, some Range object methods require that the range contain data. If the range does not contain data, the method fails
c) An external error occured, such as a failure to read or write from a file.
Last edited by Leith Ross; 07-17-2008 at 02:00 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks