Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing from Excel to Access
I need to take 2 data reports, held in Excel, upload them to separate
tables in Access, execute a query to find the difference between the two and output this reconciliation to the same Excel workbook, albeit a different sheet. Most of this I have found straightforward, but it is using Excel as an initial data source that is holding things up at the minute. I would like to import data held in a sheet of an Excel workbook into an Access database using a SQL query within VBA. The Excel workbook is connected via DSN and ADO to the Access database in question. I would like to know if it is possible to execute a query such as the following: cn.Execute "INSERT INTO TestCRecon ('ColumnA', 'ColumnB', 'ColumnC) SELECT 'Column A', 'Column B', 'Column C' FROM ExcelWorkbook.Worksheet I have seen similar posts suggesting the following in place of ExcelWorkbook.Worksheet: [EXCEL 2003;C:\Task\Data.xls].[Sheet1$]" but it hasn't worked for me. Can anybody help? Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing from Excel to Access
Why not just link the Excel tables to your access DB ?
Then can just query those linked tables. NickHK wrote in message ups.com... I need to take 2 data reports, held in Excel, upload them to separate tables in Access, execute a query to find the difference between the two and output this reconciliation to the same Excel workbook, albeit a different sheet. Most of this I have found straightforward, but it is using Excel as an initial data source that is holding things up at the minute. I would like to import data held in a sheet of an Excel workbook into an Access database using a SQL query within VBA. The Excel workbook is connected via DSN and ADO to the Access database in question. I would like to know if it is possible to execute a query such as the following: cn.Execute "INSERT INTO TestCRecon ('ColumnA', 'ColumnB', 'ColumnC) SELECT 'Column A', 'Column B', 'Column C' FROM ExcelWorkbook.Worksheet I have seen similar posts suggesting the following in place of ExcelWorkbook.Worksheet: [EXCEL 2003;C:\Task\Data.xls].[Sheet1$]" but it hasn't worked for me. Can anybody help? Thanks in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing from Excel to Access
Thanks, I'll try that, although am getting some odd results when using
linked tables compared to copy and paste so far. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing from access to excel | Excel Discussion (Misc queries) | |||
Importing data from Access to Excel, but I need to vary the table from Access | Excel Programming | |||
Importing to access from excel | Excel Discussion (Misc queries) | |||
Importing Access mdb to Excel | Excel Programming | |||
importing access mdb in to excel | Excel Programming |