I am trying to refresh Pivot tables from VBA in Access - This code works great except it won't close the Excel App window - it closes the workbook but not the app. As you can see I am setting the XLS to quit - so why doesn't it?
Here is my current code:
Sub OpenXL_Pivot(pstrWorkbook As String)
Dim xlWorkbook As Excel.Workbook, xlsApp As Excel.Application
Dim xlPivotCache As Excel.PivotCache
On Error GoTo Error_Label
' get (or open) workbook
Set xlWorkbook = GetObject(pstrWorkbook)
' refresh all pivot tables
For Each xlPivotCache In xlWorkbook.PivotCaches
On Error Resume Next
' make sure everything is visible...
xlWorkbook.Windows(1).Visible = True
xlWorkbook.Application.Visible = True
Set xlPivotCache = Nothing
Set xlWorkbook = Nothing
Set xlsApp = Nothing
Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®.
Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear? Sometimes you may have an additional problem: where the devil did they go? If you last had a popup form open…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string.
Specify the first argument, which is the expression to be returned:
Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …