Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I was wondering if anyone can guide me on how create a new workbook from Access for excel using VBA. I tried the following, but it gives me an error: Run Time error - 2302 - Microsoft Access can't save the output data to the file you've selected DoCmd.OutputTo acOutputTable, "TBL_USERS", acFormatXLS, FileNameArray(index) FileNameArray is an array with the names of the file. Initially i thought the array could be empty, but it isn't. Will appreciate an idea, or an alternate code that might be helpful. Thanks, Ali |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ali
It's almost always because the path to the file is invalid. The use of the array should not be causing a problem. When you get the error, open the Debug window and type ?Dir(FileNameArray(index)) If you get an empty string, the path isn't right. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com Tj wrote: Hi, I was wondering if anyone can guide me on how create a new workbook from Access for excel using VBA. I tried the following, but it gives me an error: Run Time error - 2302 - Microsoft Access can't save the output data to the file you've selected DoCmd.OutputTo acOutputTable, "TBL_USERS", acFormatXLS, FileNameArray(index) FileNameArray is an array with the names of the file. Initially i thought the array could be empty, but it isn't. Will appreciate an idea, or an alternate code that might be helpful. Thanks, Ali |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Refresh pivot table in workbook A when changing a cell in workbook | Excel Worksheet Functions | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming | |||
Open a password protected excel workbook from second workbook to fetch data using dynamic connection | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |