By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,462 Members | 2,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,462 IT Pros & Developers. It's quick & easy.

docmd.transferspreadsheet unexpected error

P: n/a
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of
code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"tblTest", pathAndFilename, True

The above line works perfectly fine, but when I change the table name
argument (tblTest) to the name of a query, it fails and gives the
following error:

Runtime error 3275
Unexpected error from external database driver (22).

The help file with Access 2000 states that it is possible to use a
query instead of a table name, but a sql statement cannot be used - it
must first be saved in a query. I'm not using an sql statement, but
rather a saved query, and I still get the error. According to the
help file this should be working:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"qryTest", pathAndFilename, True

Anybody have any ideas? Thanks in advance.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
user_5701 wrote:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of
code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"tblTest", pathAndFilename, True

The above line works perfectly fine, but when I change the table name
argument (tblTest) to the name of a query, it fails and gives the
following error:

Runtime error 3275
Unexpected error from external database driver (22).

The help file with Access 2000 states that it is possible to use a
query instead of a table name, but a sql statement cannot be used - it
must first be saved in a query. I'm not using an sql statement, but
rather a saved query, and I still get the error. According to the
help file this should be working:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"qryTest", pathAndFilename, True

Anybody have any ideas? Thanks in advance.


Do you have a small lookup table to make a test on? One that has 3 or 4
records? Create a query on that table. A real simple one. Ex:
Select ID, Description From LookupTable;
Does it work on your machine?

If so, then there is something in your query that is causing a problem.
Does you query have subqueries in it? Does it have have a function
call...ex NZ(), CINT(), or custom functions you have written? Is it a
Totals query where you are grouping the results? Do you have
calculated fields in it? IOW, is the query a simple select query or is
it a complex query?

It should work using your syntax. Finding out if it works with a real
simple query would be the first step to check. If not, start breaking
your query down (make a copy of the originial) and start removing
columns until it finally works.

Nov 13 '05 #2

P: n/a
Yes, all my queries are simple queries. I made a very simple query
which selected one field from a table, no where conditions or
anything, and it didn't work. I first thought it was the * that was
the problem, but that wasn't it. I went down the line and tried all
my reports and realized some it worked with, and some it didn't, but I
think I have the problem pinpointed now:

The name you give the excel spreadsheet file you're exporting to must
be 31 characters or less. If you name it 32 or more characters,
you'll get the error, but 31 or less will work fine. I was just
naming the spreadsheet the same name as the query and found some of my
queries with shorter names worked but a few didn't.

This is rather odd, and I wonder why Microsoft doesn't mention
anything about it in their help file for the transferspreadsheet
command.

Does anyone know why this is?

Salad <oi*@vinegar.com> wrote in message news:<FM****************@newsread3.news.pas.earthl ink.net>...
user_5701 wrote:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of
code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"tblTest", pathAndFilename, True

The above line works perfectly fine, but when I change the table name
argument (tblTest) to the name of a query, it fails and gives the
following error:

Runtime error 3275
Unexpected error from external database driver (22).

The help file with Access 2000 states that it is possible to use a
query instead of a table name, but a sql statement cannot be used - it
must first be saved in a query. I'm not using an sql statement, but
rather a saved query, and I still get the error. According to the
help file this should be working:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"qryTest", pathAndFilename, True

Anybody have any ideas? Thanks in advance.


Do you have a small lookup table to make a test on? One that has 3 or 4
records? Create a query on that table. A real simple one. Ex:
Select ID, Description From LookupTable;
Does it work on your machine?

If so, then there is something in your query that is causing a problem.
Does you query have subqueries in it? Does it have have a function
call...ex NZ(), CINT(), or custom functions you have written? Is it a
Totals query where you are grouping the results? Do you have
calculated fields in it? IOW, is the query a simple select query or is
it a complex query?

It should work using your syntax. Finding out if it works with a real
simple query would be the first step to check. If not, start breaking
your query down (make a copy of the originial) and start removing
columns until it finally works.

Nov 13 '05 #3

P: n/a
The worksheet name (tabs at bottom that default to "Sheet1, Sheet2, etc.) in
a workbook is limited to 31 characters. Unless you supply a "range" argument
with the TransferSpreadsheet Method, the query or table name will be used as
the sheet name and must conform to the 31 character limit or error 3275 is
thrown. May be documented somewhere. . . I learned by trial and error also.
"user_5701" <us*******@hotmail.com> wrote in message
news:f1**************************@posting.google.c om...
Yes, all my queries are simple queries. I made a very simple query
which selected one field from a table, no where conditions or
anything, and it didn't work. I first thought it was the * that was
the problem, but that wasn't it. I went down the line and tried all
my reports and realized some it worked with, and some it didn't, but I
think I have the problem pinpointed now:

The name you give the excel spreadsheet file you're exporting to must
be 31 characters or less. If you name it 32 or more characters,
you'll get the error, but 31 or less will work fine. I was just
naming the spreadsheet the same name as the query and found some of my
queries with shorter names worked but a few didn't.

This is rather odd, and I wonder why Microsoft doesn't mention
anything about it in their help file for the transferspreadsheet
command.

Does anyone know why this is?

Salad <oi*@vinegar.com> wrote in message

news:<FM****************@newsread3.news.pas.earthl ink.net>...
user_5701 wrote:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of
code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"tblTest", pathAndFilename, True

The above line works perfectly fine, but when I change the table name
argument (tblTest) to the name of a query, it fails and gives the
following error:

Runtime error 3275
Unexpected error from external database driver (22).

The help file with Access 2000 states that it is possible to use a
query instead of a table name, but a sql statement cannot be used - it
must first be saved in a query. I'm not using an sql statement, but
rather a saved query, and I still get the error. According to the
help file this should be working:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"qryTest", pathAndFilename, True

Anybody have any ideas? Thanks in advance.


Do you have a small lookup table to make a test on? One that has 3 or 4
records? Create a query on that table. A real simple one. Ex:
Select ID, Description From LookupTable;
Does it work on your machine?

If so, then there is something in your query that is causing a problem.
Does you query have subqueries in it? Does it have have a function
call...ex NZ(), CINT(), or custom functions you have written? Is it a
Totals query where you are grouping the results? Do you have
calculated fields in it? IOW, is the query a simple select query or is
it a complex query?

It should work using your syntax. Finding out if it works with a real
simple query would be the first step to check. If not, start breaking
your query down (make a copy of the originial) and start removing
columns until it finally works.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.