Error- could not find object

A

Andy

I have a TransferSpreadsheet action in my macro where I
want to export the results of a select query into excel
10 named "Query1". I type in the name of the query into
the "table name" field and I type the file name of the
excel spreadsheet into the file name field.
However, when the macro runs, I get an error that the
database engine can not find the object "Query1".

What I am I doing wrong here?
I know that a select query can be used in a macro in this
way....

-andy
 
K

Ken Snell

Just guessing, but did you put " marks around the query name? If yes, don't.

If this isn't the solution, then post the specific entries that you have for
the TransferSpreadsheet arguments -- exactly as they show in the macro
design window.
 
A

Andy

No, I don't have quotes around the query name.
For the Transferspreadsheet argument:

Transfer type: Export
Spreadsheet type: Microsoft Excel 8-10
Table Name: Query1
File Name: C:\Documents and Settings\user1.domain\My
Documents\Tally Sheet\Excel Test
Has Field Names: Yes
Range: null

This seems faily straightfoward to me, so I'm not sure
what the problem is.

-andy
 
K

Ken Snell

I have seen this error before, and it usually doesn't have anything to do
with Query1 not being there. This error occurs when ACCESS finds something
that it doesn't like in the action you're trying to do, and it throws this
error. Let me think, what was the reason when I last saw this type of
error.......

< thinking >

< more thinking >

If I recall correctly, it may be the length of your "filename" argument. Try
changing it to a much shorter path (say, C:\Filename.xls) and let's see if
the error goes away.

I also note that you don't have a filename extension on your filename; you
might try adding ".xls" to the name as well.

Also, did you actually put Null in as the argument for the Range? If yes,
delete that and leave it empty. Range is a string and Null isn't valid for a
string.
 
A

Andy

Yeah I tried saving it just to the C:\ folder and it
worked just fine, I guess I just won't use the my
documents folder on this one.
I didn't have the word Null in the range box, the range
box has to be left empty when doing an export like this.

Thanks for your help!!

-andy

-----Original Message-----
I have seen this error before, and it usually doesn't have anything to do
with Query1 not being there. This error occurs when ACCESS finds something
that it doesn't like in the action you're trying to do, and it throws this
error. Let me think, what was the reason when I last saw this type of
error.......

< thinking >

< more thinking >

If I recall correctly, it may be the length of your "filename" argument. Try
changing it to a much shorter path (say,
C:\Filename.xls) and let's see if
 

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

Top