Need help defining a range in VB code

  • Thread starter Thread starter JC
  • Start date Start date
J

JC

Hey there,

I am trying to import an excel spreadsheet using the code below. Every

time it gives me a "cannot locate object" error.


Does anyone know what I am doing wrong?


DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblTest",

"H:\everyone\Shared\ASC Processes\State Aid Processing
Databases\Lexington Hurns.xls", 0, "Lexington Hurns!Total Cvue Data"

I tried a few different scenarios.


Thank you in advance,


JC
 
I had a similar problem and I found that for some reason Access assumes that
the first word after the sub-directory is the name of the file.

In your case Access assumes Process is the name of your spreadsheet. I had
to ensure there were no spaces in the sub-directory or file name in your
case I would have to have the following
"H:\everyone\Shared\ASC_Processes\State_Aid_Processing_Databases\Lexington_H
urns.xls", 0, "Lexington Hurns!Total_Cvue_Data"

Allan Murphy
Email: (e-mail address removed)
 
Van,

Sorry I sent you a message personally. That was rude, I forgot my User
Group etiquette. I was wondering what a Microsoft MVP was exactly? I
have seen a few different individuals out here with that designation.

Thank you,

Justin
 
Most regular respondents don't actually use their e-mail address on public
newsgroups as they get spammed. At one stage, I used my real email address
and I got 100+ spam maile everyday.

Since I use munged e-mail address, you mail never got to me anyway.

For MVP, see:

<http://mvp.support.microsoft.com<
 
thanks Van

Justin
Most regular respondents don't actually use their e-mail address on public
newsgroups as they get spammed. At one stage, I used my real email address
and I got 100+ spam maile everyday.

Since I use munged e-mail address, you mail never got to me anyway.

For MVP, see:

<http://mvp.support.microsoft.com<
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top