I have an excel command button which simply copies the contents of one sheet to another. I am trying to run this command from within access. I do not get an error, however when I run the code from access, the information is not copied in excel. The code is below. Any ideas?
'
Private Sub Command92_Click()
Dim x2 As Object
Dim GetDBPath As String
GetDBPath = CurrentProject.Path & "\" & "Reports.xlsm"
Set x2 = CreateObject("Excel.Application")
x2.Workbooks.Open (GetDBPath)
x2.Visible = True
x2.Run CommandButton1_Click
x2.ActiveWorkbook.Close (True)
x2.Quit
Set x2 = Nothing
End Sub'