Advertisement

05.16.2008 at 09:20AM PDT, ID: 23408845
[x]
Attachment Details

exporting tables to specific excel worksheets in vba results in errors

Asked by Forensicon in Access Coding/Macros, Microsoft Access Database, Visual Basic Programming

Tags: microsoft, access, 2003

Using examples i found on EE i was able to write a module that automatically exports specific tables to specific excel worksheets within a single workbook. This works only sometimes though and i can't figure out what the problem is. Attached you will find the code i wrote. The error message i get is "The Microsoft Jet database engine could not find the object ". Make sure the object exists and that you spell its name and the path name correctly. " Also, i'm running into a problem for one of the exports. As you can see in Lines 5 and 6, i'm trying to export two different tables data to the same worksheet. Apparently Access doesn't like this for some reason or i'm missing something. Any ideas experts?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "UP_Doc and Settings User Profiles", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "1A_User Profiles!A1:C1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "FC_Count of File Creations by Day", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "2A_File Creation by Day!A1:C1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "DEL_Count of Files with Deleted in Description by LA day", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "3A_Files with Deleted!A1:B1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "DEL_Info/Info2 Records", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "4A_Info-Info2!A1:D1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "IH_IE History by URL Host", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "5A-B_Internet History!A1:B1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "IH_IE History by LA", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "5A-B_Internet History!D1:E1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "IH_IE History  Webmail by URL Host by LA", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "5C_Email Accounts!A1:C1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "USB_Friendly Names in USBSTOR", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "6A_USBSTOR!A1:D1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "LNK_Link Files grouped by Serial Number", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "6B_Link File References!A1:J1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "FE_Prefetch Files with Hashsets", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "7A_Prefetch Entries!A1:E1"
 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "FE_ File Extensions by Categories", "C:\Documents and Settings\yschiff\Desktop\R1 Graph Creation1.xls", False, "8A_File Extensions!A1:F1"
[+][-]05.16.2008 at 09:23AM PDT, ID: 21584138

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:44AM PDT, ID: 21584302

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:45AM PDT, ID: 21584308

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:54AM PDT, ID: 21584376

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:59AM PDT, ID: 21584406

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database, Visual Basic Programming
Tags: microsoft, access, 2003
Sign Up Now!
Solution Provided By: matthewspatrick
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.16.2008 at 10:06AM PDT, ID: 21584456

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 10:11AM PDT, ID: 21584501

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 10:29AM PDT, ID: 21584710

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628