![]() |
Excel's Marco Convert data to Access
Thank you for reading my post.
I want to write a marco which can auto convert the excel sheet data into a existing access table. This program is design for new user to excel and access. Just click the marco will auto do all steps. Thank you. |
Excel's Marco Convert data to Access
Paul
You don't give a lot of details, so I can't give you a lot of details. Here's an example that appends the data in a range called MyTable on the ActiveSheet to a table in the database c:\Dick\db1.mdb called Table 1. You need to set a reference in the VBE (Tools - References) to the Microsoft Access x.x Object Library. This is using XL2000, Acc97 and Win98. Sub AppendAccessTable() Dim acapp As Access.Application Set acapp = New Access.Application ThisWorkbook.Save acapp.OpenCurrentDatabase "C:\Dick\db1.mdb" acapp.DoCmd.TransferSpreadsheet acImport, _ acSpreadsheetTypeExcel97, _ "Table 1", _ ThisWorkbook.FullName, _ True, _ "MyTable" acapp.Quit Set acapp = Nothing End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Paul" wrote in message ... Thank you for reading my post. I want to write a marco which can auto convert the excel sheet data into a existing access table. This program is design for new user to excel and access. Just click the marco will auto do all steps. Thank you. |
All times are GMT +1. The time now is 10:33 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com