Re: Import Excel sheet

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



This worked like a charm. Sorry it took so long to get back.

Thanks a million!!!!!!!!!!!!!!!!!!!!
--
James Gaylord
Finder of Paths, Hunter of Prey
Ghost of the Night, Shadow of Day
The Wolf


"Robin" wrote:

I'm importing a particular *** from Excel and the *** has both a space
and a hyphen in the name.

You may need to reference the *** by adding ! after the *** name:

DoCmd.TransferSpread*** acImport, , "WalmartStores", stDocName, True,
"Wal-Mart Stores!"

Worth a try - worked for me (but Office 2003).

R

"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0195D281-E740-400A-9D3B-DD74078B5D0A@xxxxxxxxxxxxxxxx
Okay, I have done some extensive testing on this and found the problem.
Access does not like the space or the - in the *** name. I tried every
variation I could think of. With no space and a - It did not like it. I
tried spaces and no - it did not like it. I am getting the same error you
are (3011).

It needs to be WalmartStores or it won't find it. I don't know why. You
will have take spaces and - out of the *** name.

I know there is a way to addess the ordinal position of a ***, but I
can't
remember it and I can't find it. I tried a lot of ways, but none worked.

"Cyberwolf" wrote:

On the first one I am getting a sub or function not defined and
highlights
***(1)

On the second one I am getting a runtime erro 3011 "could not find
object
'Wal-Mart Stores'"

I double checked the path in the stDocnName and it is correct. I am
using
Office2000 and going across a windows network. Here is the stDocName

stDocName = "G:\Accounting\AR\AR Database\walmart stores.xls"

--
James Gaylord
Finder of Paths, Hunter of Prey
Ghost of the Night, Shadow of Day
The Wolf


"Klatuu" wrote:

Your second example appears to be correct. What errors or results are
you
getting?

"Cyberwolf" wrote:

This:
DoCmd.TransferSpread*** acImport, , "WalmartStores", stDocName,
True,
***(1)

And this:

DoCmd.TransferSpread*** acImport, , "WalmartStores", stDocName,
True,
"Wal-Mart Stores"

These are the 2 ways I tried. The second one I physically copied the
name
of the *** and pasted it adding the quote marks.

Thanks
--
James Gaylord
Finder of Paths, Hunter of Prey
Ghost of the Night, Shadow of Day
The Wolf


"Klatuu" wrote:

Post the code and let's see if we can debug it. Using the Range
argument
does work, it just needs the correct syntax.

"Cyberwolf" wrote:

Hi,

I am trying to import a specific *** in a workbook that has
several
sheets. I know I need to use the transferspreadsheet method, but
I am not
sure how to format the range I have tried ***(1) and also the
name
"Wal-Mart Stores" with no success. Any help would be
appreciated.

Thanks,
--
James Gaylord
Finder of Paths, Hunter of Prey
Ghost of the Night, Shadow of Day
The Wolf



.


Quantcast