Exporting Access tbl to Excel - Worksheet Names 
Author Message
 Exporting Access tbl to Excel - Worksheet Names

Hi,

I have an Access97 database, from which I export a number of tables to a
single Excel97 workbook.

The command for this is as follows (I loop through it several times for
different tables):

 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
Trim(strTableName), strOutFile, True

The problem occurs with the worksheet names in the resulting workbook.  Some
are prefixed with an underscore ("_"), while others are not.

I first thought it was because some of the table names began with a zero(0),
so I placed a character in front of the table name, but still, some have the
underscore prefix.

I have tried (as you can see from the command above) "T{*filter*}" the table
name before exporting, but again, same problem.

Any suggestions?

Thanks,
Scott



Mon, 02 May 2005 23:27:59 GMT  
 Exporting Access tbl to Excel - Worksheet Names
My experience is that the underscore is used to replace various "nonnormal"
characters. Post some examples of the table names that get the underscore
and let's see.
--
Hoping that this is helpful...
       Ken Snell
<MS ACCESS MVP>


Quote:
> Hi,

> I have an Access97 database, from which I export a number of tables to a
> single Excel97 workbook.

> The command for this is as follows (I loop through it several times for
> different tables):

>  DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
> Trim(strTableName), strOutFile, True

> The problem occurs with the worksheet names in the resulting workbook.
Some
> are prefixed with an underscore ("_"), while others are not.

> I first thought it was because some of the table names began with a
zero(0),
> so I placed a character in front of the table name, but still, some have
the
> underscore prefix.

> I have tried (as you can see from the command above) "T{*filter*}" the table
> name before exporting, but again, same problem.

> Any suggestions?

> Thanks,
> Scott



Tue, 03 May 2005 12:48:03 GMT  
 Exporting Access tbl to Excel - Worksheet Names
Well, the strings being used for the worksheet tab names are first Table
names in Access.

The application basically does this:

1. reads in a text file containing model #'s and some associated
information.
2. for each Model #, a table is created with the same name, and the
associated data is then loaded into the table. (the reason for creating a
separate table for each model is to provide the worksheet names when
exported)
3. all the tables are then exported to a single workbook, with each tables'
data being placed in a separate worksheet

In the process, each table in Access is created on the fly, then deleted
once the data has been exported.

Some of the table names are as follows:
MS440
MS220
BG55
FS55
FS200
MS034
MS026
etc....

The only ones displaying the problem are those begining with "F" or "B".
Very strange, but there has to be a reason for it!

Thank-you for your reply.
Scott

Quote:

>My experience is that the underscore is used to replace various "nonnormal"
>characters. Post some examples of the table names that get the underscore
>and let's see.
>--
>Hoping that this is helpful...
>       Ken Snell
><MS ACCESS MVP>



>> Hi,

>> I have an Access97 database, from which I export a number of tables to a
>> single Excel97 workbook.

>> The command for this is as follows (I loop through it several times for
>> different tables):

>>  DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
>> Trim(strTableName), strOutFile, True

>> The problem occurs with the worksheet names in the resulting workbook.
>Some
>> are prefixed with an underscore ("_"), while others are not.

>> I first thought it was because some of the table names began with a
>zero(0),
>> so I placed a character in front of the table name, but still, some have
>the
>> underscore prefix.

>> I have tried (as you can see from the command above) "T{*filter*}" the table
>> name before exporting, but again, same problem.

>> Any suggestions?

>> Thanks,
>> Scott



Wed, 04 May 2005 02:56:06 GMT  
 Exporting Access tbl to Excel - Worksheet Names
Nothing seems obviously wrong with what you're doing. May I suggest a bit of
debugging? In your code that does this work, insert steps (Debug.Print
variablename) at various steps to print out the value of the string variable
that is used for the table name. See if you can find where the "change" is
occurring. That may help determine where/when/why it's happening.

--
Hoping that this is helpful...
       Ken Snell
<MS ACCESS MVP>


Quote:
> Well, the strings being used for the worksheet tab names are first Table
> names in Access.

> The application basically does this:

> 1. reads in a text file containing model #'s and some associated
> information.
> 2. for each Model #, a table is created with the same name, and the
> associated data is then loaded into the table. (the reason for creating a
> separate table for each model is to provide the worksheet names when
> exported)
> 3. all the tables are then exported to a single workbook, with each
tables'
> data being placed in a separate worksheet

> In the process, each table in Access is created on the fly, then deleted
> once the data has been exported.

> Some of the table names are as follows:
> MS440
> MS220
> BG55
> FS55
> FS200
> MS034
> MS026
> etc....

> The only ones displaying the problem are those begining with "F" or "B".
> Very strange, but there has to be a reason for it!

> Thank-you for your reply.
> Scott


> >My experience is that the underscore is used to replace various
"nonnormal"
> >characters. Post some examples of the table names that get the underscore
> >and let's see.
> >--
> >Hoping that this is helpful...
> >       Ken Snell
> ><MS ACCESS MVP>



> >> Hi,

> >> I have an Access97 database, from which I export a number of tables to
a
> >> single Excel97 workbook.

> >> The command for this is as follows (I loop through it several times for
> >> different tables):

> >>  DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
> >> Trim(strTableName), strOutFile, True

> >> The problem occurs with the worksheet names in the resulting workbook.
> >Some
> >> are prefixed with an underscore ("_"), while others are not.

> >> I first thought it was because some of the table names began with a
> >zero(0),
> >> so I placed a character in front of the table name, but still, some
have
> >the
> >> underscore prefix.

> >> I have tried (as you can see from the command above) "T{*filter*}" the
table
> >> name before exporting, but again, same problem.

> >> Any suggestions?

> >> Thanks,
> >> Scott



Wed, 04 May 2005 07:41:11 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Export access table to excel worksheet

2. Export Excel worksheets to separate files (VBA)

3. Export to Excel - Multiple Worksheets

4. Getting Excel worksheet names using DAO.

5. How to get Excel worksheet names

6. How to get Excel worksheet name and summary information

7. Return Excel Worksheet Names

8. function to see if an Excel worksheet name exitsts in a workbook

9. HOW DO I DETECT EXCEL-WORKSHEET NAMES

10. detect the worksheet-names in an EXCEL 5.0 workbook

11. chaning excel worksheet name

12. Howto list all the names of your worksheets in Excel

 

 
Powered by phpBB® Forum Software