wo*******@yahoo .com wrote:
I have a CSV file that is downloaded twice a day.
The file comes zipped (And they won't change it for me)
Is it possible to open the Zipfile and a import the file contained with
in it?
(I'll have the user browse to the Zip file, then my code should open
the zip and pull out the CSV file)
I want to use VBA to open the CSV file and then add it to a recordset
once I have ran a few functions on it.
Thanks in advance for any help.
Check out the Shell function. You can also check out
http://www.mvps.org/access for API functions. One of them opens the
application file based on the associated extension.
You might want to make this a 2 step process. Create a command button
to do a FileOpen and get the zip file name. (see API functions at web
link
http://www.mvps.org/access for FileOpen dialog box). Once found,
run the API call to open the Zip or Shell function. Then press a
command button to import.
You may be able to automate it more based on your naming schemes of the
zip and csv file. I don't know if you are overwriting the same zip file
name each time or opening the zip file with the rest of the CSV and csv
files.