I had an issue previously with the IBM Framework for Office clashing with something when I updated to PAW 2.0.65
What version are you on? Did you previously enable the IBM Framework for Office as a COM add-in as well?
With PAfE 2.0.65 onwards, make sure that all PAfE and the IBM framework have been uninstalled.
I had an issue where my installation was not showing in Add or Remove Programs and I had to run the Uninstall from the folder in C:\Program Files\ibm\cognos\. Once this was removed and I restarted Excel with PAfE, in my case 2.0.67, all worked as expected.
I use as a simple refresh and also for dynamic report rebuilds in PAfE 2.0.68. In the VBA itself I have never imported CognosOfficeAutomationExample.bas or CognosOfficeMessageSuppressor.cls into the project but it seems to work fine and has done for the last few versions at least.
Sub refreshData()
' Application.COMAddIns("CognosOffice12.Connect").Object.AutomationServer.Application("COR", "1.1").RefreshBook
Application.COMAddIns("CognosOffice12.Connect").Object.AutomationServer.Application("COR", "1.1").RefreshSheet
' Application.COMAddIns("CognosOffice12.Connect").Object.AutomationServer.Application("COR", "1.1").RefreshAllData
' Application.COMAddIns("CognosOffice12.Connect").Object.AutomationServer.RefreshAllData
End Sub
When I hit the F5 key within the Sub in the VBA editor, in all cases I get the error
Runtime error '91': Object variable or With block variable not set"
What do they mean by "Object variable" or "With block variable" that needs to be set?
I wonder also, how VBA would know which sheet to refresh, if I only say RefreshSheet?
Sub refreshData()
' Call over object variable
Dim CognosOfficeAutomationObject As Object
Set CognosOfficeAutomationObject = Application.COMAddIns("CognosOffice12.ConnectPAfEAddin").Object.AutomationServer
CognosOfficeAutomationObject.RefreshAllData
' direct call
Application.COMAddIns("CognosOffice12.ConnectPAfEAddin").Object.AutomationServer.Application("COR", "1.1").RefreshBook
Application.COMAddIns("CognosOffice12.ConnectPAfEAddin").Object.AutomationServer.Application("COR", "1.1").RefreshSheet
Application.COMAddIns("CognosOffice12.ConnectPAfEAddin").Object.AutomationServer.RefreshAllData
End Sub
So, for now the problem is kinda solved, till IBM changes something in the near future and it crashes again
Although if you read the whole link, this shouldn't be necessary. I'd be more concerned with getting the install right rather than amending the VBA code to partially fix something that's broken (and might fix itself in future, then giving you an issue with the VBA code that now no longer works).