Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TransferSpreadsheet to two tabs 1

Status
Not open for further replies.

AlexCuse

Programmer
Apr 13, 2006
5,416
US
Hi All,

I just received a request to change some reports that are automatically generated from Access. I now need to use TransferSpreadsheet for two queries, and transfer them into a new spreadsheet as separate tabs.

Any advice on this would be much appreciated.

Thanks,

Alex


It's a magical time of year in Philadelphia. Eagles training camp marks the end of another brutal season of complaining about the Phillies.
 
AlexCuse,
[tt]TransferSpreadsheet([TransferType], [SpreadsheetType], [TableName], [FileName], [HasFieldNames], [Range], [UseOA])[/tt]

Make sure the filename is the same and specify two different range arguments?

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
I will try this out. Is range the name of the tab you want it to export to?


It's a magical time of year in Philadelphia. Eagles training camp marks the end of another brutal season of complaining about the Phillies.
 
AlexCuse,
Yep, I used [tt]Sheet1[/tt] and [tt]Sheet2[/tt] to test, but I believe that you can use anything and as long as they are different a new tab will be created.

CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
I was able to use the names I wanted. It's so much easier once I know what the parameters mean, I thought it only meant a range of cells. Thanks Caution, I was able to meet deadline without the dreaded manually moving around tabs in spreadsheets. Once again, you're the man!

Alex



It's a magical time of year in Philadelphia. Eagles training camp marks the end of another brutal season of complaining about the Phillies.
 

Help said:
Range Optional Variant. A string expression that's a valid range of cells or the name of a range in the spreadsheet. This argument applies only to importing. Leave this argument blank to import the entire spreadsheet. When you export to a spreadsheet, you must leave this argument blank. If you enter a range, the export will fail.

It is the normal behavior of access to have all epxorts to the same workbook be on different worksheets. And to be specific the query/table name exported names the worksheet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top