Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Automation from Access

Status
Not open for further replies.

scking

Programmer
Jan 8, 2001
1,263
US
I've developed some Excel macros that extract data from Access and load a spreadsheet, pulling the data into Excel. Now I need to use the code from within Access, using automation, to create the spreadsheets. I'm attempting to use the same functions but have run into a problem. Although the following snippet works fine in Excel when I use Intellisense it no longer provides drop downs for QueryTables. Does anyone know or has anyone experienced this problem? Most of the code migrates to Access with no problems but this is a significant obstacle for the entire application.

With ActiveSheet.QueryTables.Add(Connection:=rstData, _
Destination:=Range("A1"))
.Refresh
End With

Modified for automation:
With oExcel.ActiveSheet.QueryTables.Add(Connection:=rstData, _
Destination:=Range("A1"))
.Refresh
End With


-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top