How would i open a new Excel Spreadsheet from within Access using script, then save it with a specific name once id added data to it?
Hope thats clear,
Chris
Printable View
How would i open a new Excel Spreadsheet from within Access using script, then save it with a specific name once id added data to it?
Hope thats clear,
Chris
For starters you need to add a reference to Excel under Project > References.
Moved from Classic VB forum.VB Code:
Option Explicit Private Sub CommandButton1_Click() Dim oApp As Excel.Application Dim oWB As Excel.Workbook Set oApp = New Excel.Application Set oWB = oApp.Workbooks.Add oWB.Sheets("Sheet1").Cells(1, 1) = "SomeValue" oWB.Close SaveChanges:=True, FileName:="C:\Test.xls" Set oWB = Nothing oApp.Quit Set o App = Nothing End Sub
Cheers for the answer, sorry for posting in the wrong section!! :blush:
Chris
No problem. It takes a while to get the feel for where things go. ;)
Glad to help :)
Mark as resolved pls!.. the code works good!
Thanks.
You can mark the thread as Resolved if you go to the Thread Tools menu and click "Mark Thread as Resolved". :)