P
Please Help
I have created a pivot table in Excel that is linked to a
MS Access database. I have a command in Access that will
open excel and the pivot table file. However, when it
opens I cannot click any where on the table (can't double
click, right click, etc.) Once I minimize excel and
maximize it again I then am able to click anywhere on the
table and refresh data. Can anyone tell me why this is
happening? I need to be able to click on the table as
soon as the file is open without having to minimize and
maximize again. The following is the code I am using in
Access to open the excel sheet.
Sub Open_File()
On Error GoTo Err_Command24_Click
Dim oApp As Object
Dim myExl As Object
On Error GoTo err_cmdOpen
Set oApp = GetObject(, "Excel.Application")
err_cmdOpen:
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
Set myExl =
GetObject"C:\ResourcePlanning\AllocationReport.xls")
'oApp.Visible = True
myExl.Windows(1).Visible = True
On Error Resume Next
Exit_Command24_Click:
Exit Sub
Err_Command24_Click:
MsgBox Err.Description
Resume Exit_Command24_Click
End Sub
MS Access database. I have a command in Access that will
open excel and the pivot table file. However, when it
opens I cannot click any where on the table (can't double
click, right click, etc.) Once I minimize excel and
maximize it again I then am able to click anywhere on the
table and refresh data. Can anyone tell me why this is
happening? I need to be able to click on the table as
soon as the file is open without having to minimize and
maximize again. The following is the code I am using in
Access to open the excel sheet.
Sub Open_File()
On Error GoTo Err_Command24_Click
Dim oApp As Object
Dim myExl As Object
On Error GoTo err_cmdOpen
Set oApp = GetObject(, "Excel.Application")
err_cmdOpen:
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
Set myExl =
GetObject"C:\ResourcePlanning\AllocationReport.xls")
'oApp.Visible = True
myExl.Windows(1).Visible = True
On Error Resume Next
Exit_Command24_Click:
Exit Sub
Err_Command24_Click:
MsgBox Err.Description
Resume Exit_Command24_Click
End Sub