Exporting Access -> Excel

  • Thread starter Thread starter setterst
  • Start date Start date
S

setterst

I am quite new to VBA and Access, but I am trying to figure out how to
export specific values from a table in Access, so I can save it in a
given cell in Excel. I have been able to figure out how to open and
modify cells in my spreadsheet, but I don't understand how to select
elements of the Access table to export it to Excel. Here is what I
have so far:

Dim xlApp As Object
Dim wkbk As Object
Dim Sheet As Object, Cell As Object
Dim Q2CNumber As Object

Set xlApp = CreateObject("Excel.Application")
Set wkbk = xlApp.Workbooks.Open("C:\Spreadsheet.xls")
Set Sheet = wkbk.Worksheets("Sheet1")
Set Cell = Sheet.Range("B3")

' Saving Spreadsheet and quiting Excel
wkbk.SaveAs "C:\Spreadsheet-New.xls"
xlApp.Quit

Thank you for the help,
Sean
 
Back
Top