I have several macros that I have used for years over various versions of Project and various versions of Windows. My current configuration is Windows version: 10.0.19045 Build 19045. I also have Office version: 2405 (Build 17628.20110 CTR) and Project 2019 Pro, same version as Office.
Today I tried running one of those macros on a test file and I immediately go this compile error
The declarations for my macros is typically this:
Option Explicit
Public Const ver = " 1.1"
Public xl As Excel.Application
Public WS1 As Worksheet, WS2 As Worksheet
Public xlRange As Range
Public r As Resource
Public a As Assignment
Public TSV1 As TimeScaleValues
Later in the macro I open an instance of Excel using this construct:
'set up an new instance of Excel, or if Excel is not running, start it
On Error Resume Next
Set xl = GetObject(, "Excel.application")
If Err <> 0 Then
On Error GoTo 0
Set xl = CreateObject("Excel.Application")
If Err <> 0 Then
MsgBox "Excel application is not available on this workstation" _
& vbCr & "Install Excel or check network connection", vbCritical, _
"Project Data Export - Fatal Error"
FilterApply Name:="all tasks"
Set xl = Nothing
On Error GoTo 0 'clear error function
Exit Sub
End If
End If
On Error GoTo 0
I have references set for the required Object libraries (i.e. Project, Office, Excel).
Thinking perhaps there was an issue related to the previous version of Office (version 2404 installed on May 14), I updated to the current version. This error still presents. Has anyone experienced this error or have suggestions for troubleshooting?