CFMI
asked on
Transferring MS Access data to MS Excel
What is the difference between the three below options when transferring a Microsoft Access 2007 data source to MS Excel 2007? Also, which do you prefer and why?
1. acSpreadsheetTypeExcel12Xm l
2. acSpreadsheetTypeExcel9
3. acFormatXLSX
1. acSpreadsheetTypeExcel12Xm
2. acSpreadsheetTypeExcel9
3. acFormatXLSX
Use
DoCmd.TransferSpreadsheet acExport, 10, etc.
DoCmd.TransferSpreadsheet acExport, 10, etc.
I initially thought acSpreadsheetTypeExcel12Xm l would create it in xml format, perhaps it can be used as part of importing but exporting does not seem to make a difference. Probably better to use acSpreadsheetTypeExcel12 though or not bother specifying (it is optional).
back to the question which do I prefer? I don't have a preference. I never specify it unless I know I will be working with a particular version of office (like handling older versions).
with regards to what command to use? well I use both and use the tool which I feel is right for the job.
with regards to what command to use? well I use both and use the tool which I feel is right for the job.
see this link
http://msdn.microsoft.com/en-us/library/bb225982%28office.12%29.aspx
scroll down to the bottom of page
http://msdn.microsoft.com/en-us/library/bb225982%28office.12%29.aspx
scroll down to the bottom of page
ASKER
Gotcha on the versioning issue (eg., acSpreadsheetTypeExcel7,8, 9, etc.). Thank you. So now I'm seeing three comparable methods:
• DoCmd.TransferSpreadsheet acExport, 10, "MyQueryName", "C:\MYxlsxFileName. xlsx ", True
• DoCmd.TransferSpreadsheet acExport, [acSpreadsheetTypeExcel12X ml] or [acSpreadsheetTypeExcel12] , "MyQueryName", "C:\MYxlsxFileName. xlsx ", True
• DoCmd.OutputTo acOutputQuery, "MyQueryName", acFormatXLSX, "C:\MYxlsxFileName.xlsx", True
Any notable differences here?
• DoCmd.TransferSpreadsheet acExport, 10, "MyQueryName", "C:\MYxlsxFileName. xlsx ", True
• DoCmd.TransferSpreadsheet acExport, [acSpreadsheetTypeExcel12X
• DoCmd.OutputTo acOutputQuery, "MyQueryName", acFormatXLSX, "C:\MYxlsxFileName.xlsx", True
Any notable differences here?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
ASKER
It's interesting that 2nd parameter - enumeration type AcSpreadSheetType - typed in and followed by . brings up "a list of constants available" (including acSpreadsheetTypeExcel7,8, 9) but NOT "10, 11, or 12." I don't know if that's dependent on the active reference library but glad to get the good info from you! Thx again.
1. create in current version. have not found any main difference between this and acSpreadsheetTypeExcel12
2. create in older version of office 2000
3. not to be used with docmd.transferspreadsheet,