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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting query results to an Excel range

Status
Not open for further replies.

razchip

Technical User
Feb 2, 2001
133
US
thread705-1619976

Jerby,

You put the following in a previous post.

Dim ExcelBook As Excel.Workbook
Dim ExcelSheet As Excel.Worksheet

Set ExcelBook = Excel.Workbooks.Open(Path to your Excel file)

Set ExcelSheet = ExcelBook.Worksheets("Worksheet Name")

ExcelSheet.Range(YourCell such as "A1").FormulaR1C1 = Data from Access
etc.

Set ExcelSheet = Nothing
ExcelBook.Close
Set ExcelBook = Nothing

As I want to export from a Query, am I to reference that in the "Data from Access etc." Not sure how to do this. If I put the query name here, it exports the query name. Not sure how to handle this.

Thanks
Greg

Thanks for the help.
Greg
 


hi,

So what's the objective?

You want to open Access, execute a query & export to Excel, then do other things in Access, then eventually do a little something in the Excel workbook with the exported data.

Or you want to open Access, execute a query & export to Excel, then open the Excel workbook and do a bunch of stuff with the exported data, cuz, that's what I'm really after.

Or something else?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top