Jumat, 16 Februari 2018

[MS_AccessPros] Re: CSV export not working

 

My original code exporting to Excel has it, just asking if I change to TXT delimited can I still export to multiple sheets in the same Excel file.


Sarah


---In MS_Access_Professionals@yahoogroups.com, <wrmosca@...> wrote :

Sarah - you can't do that with the export command. You will have to use VBA. Search the internet for "ms access excel automation". You should find ways to open an excel file (existing or new) and fill sheets with your query's data.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com



---In MS_Access_Professionals@yahoogroups.com, <sarahk@...> wrote :

I finally got back to this and I am trying it as delimited, but I need to add a worksheet/book to an existing excel file, is there a way to include this?.

In other words , I am trying to export 3 queries to one Excel file with 3 worksheets.

Is there a way to do this with export delimited text?.

Sarah


---In MS_Access_Professionals@yahoogroups.com, <wrmosca@...> wrote :

Sarah - since these are going to be csv files, export them as text, not Excel files. A csv (comma-delimited value) file is not really a spreadsheet you don't have to use Excel formatting.

DoCmd.TransferText, acExportDelim,...

You can control how the records are delimited and how strings are qualified, etc. It's much more practical. You can even manually export data as a csv and set up and save a specification. Then you can later use that specification to format your data exactly as you want.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

 


---In MS_Access_Professionals@yahoogroups.com, <sarahk@...> wrote :

I am using Access 2003 and use the following code to export to an Excel file. This code used to work fine, but no longer works.'DoCmd.TransferSpreadsheet acExport' gives me : run-time error '3274' external table is not in the expected format.



MyDocsPath = Environ$("USERPROFILE") & "\" & "My Documents\"

DoCmd.OutputTo acOutputQuery, "MLTC1b_Detail", acFormatXLS, MyDocsPath & "MLTC Summary" & Format([Forms]![mltc1]![pid from], "yyyymmdd") & ".csv", False

DoCmd.TransferSpreadsheet acExport, 8, "mltc1b_Day_summary", MyDocsPath & "MLTC Summary" & Format([Forms]![mltc1]![pid from], "yyyymmdd") & ".csv", False

DoCmd.TransferSpreadsheet acExport, 8, "mltc1b_Registrant_summary", MyDocsPath & "MLTC Summary" & Format([Forms]![mltc1]![pid from], "yyyymmdd") & ".csv", True


Maybe it is because I installed Excel 2016,  Excel 2003 is also installed in this computer. I tried changing 'acExport, 8,' to 'acExport, 9,'  and 'acExport, 10,'. I get the same error. 


Please help


Thanks 


Sarah



 

__._,_.___

Posted by: sarahk@schemesoftware.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar