Why export an entire table? You could easily set up a QUERY from Excel directly to your Access table for the subset of data that the user would need, using Data/Get External Data/New Database Query -- Access files -- YOUR DATABASE -- YOUR TABLE.....
One it's set up in Excel, all you need a Data/Refresh to get up-to-date data. Could even get new data on workbook open. Check out Data/Get External Data/Data Range Properties.
Skip, [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled... Many are cold, but few are frozen!
exporting an entire table does not make much sense to me.
It seems to me that you'd want CURRENT data in such chunks (according to some criteria) that would be useful for the immediate need.
That's what a QUERY is for, is it not?
So why not QUERY the data from Excel that you need, when you need it, in order to get the most current data and only the amount that is really required instead of the universe???
Skip, [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled... Many are cold, but few are frozen!
I tried it using: DoCmd.OutputTo acOutputTable, it works great. How do I access this file in the code as to manipulate its contents (Delete some columns) and save the table to a specific directory. Is there a command I can use to access this excel sheet that was just created? Thank you.
SkipVought thank you for your input. But unfortunately I'm still confused. Peacesine's method worked OK because the table I'm dealing with is small. Now I'm trying to manipulate the created xls sheet. Any recommendations?
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim xlws As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Open("C:\Documents and Settings\My Documents\Name.xls")
Set xlws = xlWB.ActiveSheet
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.