DVAJLOG
asked on
Using Access VBA and Excel to scrub and import a CSV file
I am using Access 97 VBA to open a CSV file using Excel 97, trim the key column, and then import it into an Access table, maintaining the CSV format until it gets to Access.
My problem is this: When VBA goes to save the file in Excel as a CSV, Excel still asks me if I want to convert to Excel 97 format. Meanwhile, my Access VBA code continues to run and tries to open the CSV file that is supposed to be saved, closed, and available.
Is there a way to turn off this convert to Excel 97 prompt?
Thanks in advance for your help.
My problem is this: When VBA goes to save the file in Excel as a CSV, Excel still asks me if I want to convert to Excel 97 format. Meanwhile, my Access VBA code continues to run and tries to open the CSV file that is supposed to be saved, closed, and available.
Is there a way to turn off this convert to Excel 97 prompt?
Thanks in advance for your help.
Why don't you just import it into access directly and skip the Excel step.
You can write code to open the file and read the text file line by line. If it is delimited you can pick out the bits you want and trim them.
Using a recordset you can then put it straight into your table.
This would be easier than what you are doing.
Let me know if you need help.
Glenn
You can write code to open the file and read the text file line by line. If it is delimited you can pick out the bits you want and trim them.
Using a recordset you can then put it straight into your table.
This would be easier than what you are doing.
Let me know if you need help.
Glenn
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- PAQ'd and pts removed
Please leave any comments here within the
next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
Nic;o)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think it is caused by having or have had any other version of Office on your computer. Even if you uninstalled the other version it can still be a problem.
Microsoft has some articles in the KB.
To completely uninstall Office look at Q254250.
It looks like a real pain.
Good Luck
Kess