Yes, it's possible. There are a few options, including [Data | Import
External Data --> New Database Query...] and using the ADODB library via
code to execute SQL Server stored procs or run ad-hoc queries. For the
first option, it's pretty straightforward and wizard-based. The second
option will require some learning if you've never done it before. Google
"Excel" and "ADO" to get an idea of how to do this.
'To use ADO objects in an application add a reference
'to the ADO component. From the VBA window select
'>Tools/References< check the box
' "Microsoft ActiveX Data Objects 2.x Library"
Private Sub CommandButton1_Click()
' This declares everying in the procedure
Dim DB_NAME As String
Dim DB_CONNECT_STRING As String
Dim Cnn As ADODB.Connection
Set Cnn = New ADODB.Connection
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.