Creating an Excel doc from Access

  • Thread starter Thread starter David Rose
  • Start date Start date
D

David Rose

I would like to have a button on an Access form that, when clicked, creates
a new Excel document from a template and then fills in specific cells with
data from the Access database.

Any code samples or places to look for more information would be a great
help.

TIA

David Rose
 
If you are using 98, dor a search for *.vbs. You should find a few VBS
files in your system that are decent examples.


Dim objXL
Dim objXLchart
Dim intRotate

Set objXL = WScript.CreateObject("Excel.Application")
objXL.Workbooks.Add
objXL.Cells(1,1).Value = 5
objXL.Cells(1,2).Value = 10
objXL.Cells(1,3).Value = 15
objXL.Range("A1:C1").Select

Set objXLchart = objXL.Charts.Add()
objXL.Visible = True
objXLchart.Type = -4100

For intRotate = 5 To 180 Step 5
objXLchart.Rotation = intRotate
Next

For intRotate = 175 To 0 Step -5
objXLchart.Rotation = intRotate
Next
 
Thanks for the help. I had been searching the web with little luck. Then I
got the bright idea to search the MSDN CDs for VS 6. The whole VBA language
reference for Access and Excel is there.
 
Back
Top