ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with pivot tables (https://www.excelbanter.com/excel-programming/288983-help-pivot-tables.html)

Please Help[_4_]

Help with pivot tables
 
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 anywhere 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


All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com