ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Access automation from Excel (https://www.excelbanter.com/excel-programming/286602-access-automation-excel.html)

AccessChallenged

Access automation from Excel
 
Hello. I need to do some automation of Access from Excel.
Can someone please point me to some good MS sites that
illustrate how to do it, its object models, etc.

For starters, could someone show me a code sample that
gets a reference to a table in an Access DB?

Thanks in advance for your example code/site refs.

Tom Ogilvy

Access automation from Excel
 
http://support.microsoft.com/?id=260410
OFF2000: Microsoft Office 2000 Automation Help File Available


http://support.microsoft.com/?id=167223
Microsoft Office 97 Automation Help File Available on MSL

http://support.microsoft.com/?id=177760
VBA: How to Run Macros in Other Office Programs


http://support.microsoft.com/?id=210111
ACC2000: Using Microsoft Access as an Automation Server

http://support.microsoft.com/?id=253338
INFO: Office Developer Samples and Tools Available for Download


http://support.microsoft.com/support...aqVBOffice.asp
Frequently Asked Questions about Microsoft Office Automation Using Visual
Basic


http://support.microsoft.com/support...fdevinapps.asp
Programming Office from Within Office

--
Regards,
Tom Ogilvy

"AccessChallenged" wrote in message
...
Hello. I need to do some automation of Access from Excel.
Can someone please point me to some good MS sites that
illustrate how to do it, its object models, etc.

For starters, could someone show me a code sample that
gets a reference to a table in an Access DB?

Thanks in advance for your example code/site refs.




SFAxess

Access automation from Excel
 
I would suggest using an ADO recordset with Excel 2000 or
above.
Note: You have to make a reference to the "Microsoft
ActiveX Data Objects 2.x Library" in the Visual Basic
EditorToolsReferences dialog to use this code.

Function OpenDataTable()
On Error GoTo HandleError

Dim rst As ADODB.Recordset
Dim cnn As ADODB.Connection

Set rst = New ADODB.Recordset
Set cnn = New ADODB.Connection

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\AccessDatabaseFile.mdb;"

rst.Open "YourTableOrQuery", cnn, adOpenKeyset,
adLockOptimistic

......Additional Code.......

ExitHe
Exit Function
HandleError:
MsgBox Err.Description
Resume ExitHere
End Function
-----Original Message-----
Hello. I need to do some automation of Access from

Excel.
Can someone please point me to some good MS sites that
illustrate how to do it, its object models, etc.

For starters, could someone show me a code sample that
gets a reference to a table in an Access DB?

Thanks in advance for your example code/site refs.
.



All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com