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

Method ListIndex failed error?

Status
Not open for further replies.

Aidy680

Technical User
Nov 1, 2006
138
GB
I've posted this in another forum (link at bottom) and advised to try over here:


Hi why is it that the following code (contained within an Excel spreadsheet) works on most machines but not on one:

.PivotTableWizard SourceType:=xlExternal, SourceData:=Array( _
"SELECT IR_Enriched_Reduced.* ", _
"FROM `" & strDBName & "`.IR_Enriched_Reduced IR_Enriched_Reduced"), _
TableDestination:=Cells(19, 4), TableName:="ptIR", BackgroundQuery:=False, Connection:=Array( _
"ODBC;Driver={Microsoft Access Driver (*.mdb)};DBQ=" & strDBName & ".mdb;DefaultDir=" & gcstrDataDirectory, _
"DriverId=281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;ReadOnly=1")

On this line I get the dreaded -2147417848 error message:

Method Listindex of object IMdcCombo failed.

From looking at other posts it seems that this is quite general.

My hunch is that it's something to do with References.

Any ideas?

Pls see link:
thread705-1306874
 



Hi,

It kind of depends on what's stored in strDBName

That name ought to include the PATH & Access File Name WITHOUT the file extension -- to the current database.

Skip,

[glasses] [red][/red]
[tongue]
 
Thanks for your reply Skip.

The variable doesn't contain an extension so that looks to be OK.

Does that help at all?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top