In my access form I have page that has an Excel worksheet linked to an object frame. (Works okay). One button on form calls the empty worksheet. I want a second button that saves the original worksheet but with data entered under a new name that is set in the code. I have a third button that calls the worksheet with data in it and allows for updates. I also want the second button to be able to save the updated worksheet without additional interface from the user.
My current code is as follows but it does not allow for the updated worksheet to be saved, once a file has been created with the Pipetally Sheet1.xls name:
Private Sub Command2_Click()
On Error GoTo Error_Command2_Click
Dim appExcel As Excel.Workbook
Set appExcel = GetObject(, "Excel.Workbook"
appExcel.SaveAs "D:\RBI Tools\Pipetally Sheet1.xls"
appExcel.Application.Quit
Set appExcel = Nothing
Exit_Command2_Click:
Exit Sub
Error_Command2_Click:
MsgBox CStr(Err) & " " & Err.Description
Resume Exit_Command2_Click
End Sub
My current code is as follows but it does not allow for the updated worksheet to be saved, once a file has been created with the Pipetally Sheet1.xls name:
Private Sub Command2_Click()
On Error GoTo Error_Command2_Click
Dim appExcel As Excel.Workbook
Set appExcel = GetObject(, "Excel.Workbook"
appExcel.SaveAs "D:\RBI Tools\Pipetally Sheet1.xls"
appExcel.Application.Quit
Set appExcel = Nothing
Exit_Command2_Click:
Exit Sub
Error_Command2_Click:
MsgBox CStr(Err) & " " & Err.Description
Resume Exit_Command2_Click
End Sub