Hi Guys
I have developed a project using Excel as a frontend and Access as a backend. Now I want to write code that will export data from
Access table to CSV file .
Can anybody please help me to do this?
Regards,
Hi Guys
I have developed a project using Excel as a frontend and Access as a backend. Now I want to write code that will export data from
Access table to CSV file .
Can anybody please help me to do this?
Regards,
You can load Access data directly into an Excel workbook.
Thaks snb, I have done that so now how can I export the data which is stored in sheet1 to csv file using vba.
In the dropdown under the file name when you click save as... You can select csv and wouldn't need to do any vba.
No actually I want to do it using vba. so that when the users select Date from and Date To and press Generate Report button then it should automatically save the data in sheet1 in CSV file in a different folder .
I am writng the following code to export excel data to CSV file.
But when I go to the Export folder and try to open the file then it gives an error message:Please Login or Register to view this content.
"Excel has detected that Test1.csv is a SYLK file but cann't load it.Either the file has errors or its not a SYLK file.Click OK to try to open the file in a different format.
I hope anyone can figure it out.
Thanks
Ohh well then.
Also, this is dangerously close to John Walkenbach's book "Excel 2007 Power Programming with VBA" PG(845-846) So I will give him the credit.Please Login or Register to view this content.
You'd better not use a function if nothing is being calculated.
Use
The problem is being caused bij the characters 'ID' in cell A1.Please Login or Register to view this content.
A preceding hyphen will solve that issue.
Last edited by snb; 12-21-2011 at 08:58 AM.
Thanks snb for your help.
Guys the code works fine but now there is one more problem, when it gets exported to CSV format then the data doesn't display
in systemetic order.For all rows the data appear in each column properly. If one column has no data for 1 row then 2nd columns
data shouldn't appear in 1st column space.
Is there any way to do something like we do in excel ws.usedrange.columns.autofit ?
Thanks
Did you read your PM ?
What is PM? Sorry I didn't get you.
I want all the data in CSV file in systemetic format so that one column data doesn't get mixed up with another column data.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks