I have inherited a legacy Excel app that is crashing in Office 10. The 2 variables in question were originally declared as 'Page' and worked fine in Excel 97-2000. These 2 variables crashed in Excel 2003 and they were changed to 'Object' and ran fine. Now these 2 problem children are causing problems in Office 10.
I have Googled this issue and haven't found anything useful. I've also researched the Excel Page Object for a better understanding of the object but, the MS site didn't really offer anything insightful. I 'think' this is a relatively simple fix, but, I am in the dark.
Should these 2 variables be declared as something different or is other code rework in order here? I didn't write the app and would rather not rework it if possible since it's something that all 50 US states use as a federal reporting tool.
It crashes on stratPage.Visible = True and throws 'Object variable or With block variable not set' error.
Public Property Let CalculateMode(value As Integer) m_CalculateMode = value ‘ The following 2 variables were originally declared as Page in Excel Version 97-2000 ' Dim stPage As Page 'Dim stratPage As Page ‘The following 2 variable declarations were changed to work in Excel 2003 Dim stPage As Object Dim stratPage As Object Set stPage = Me.TabBar.Pages.Item("tbPageState") stPage.Visible = False TabBar.Style = fmTabStyleNone If value = SSC_StateLevel Then lblWarn.Visible = False 'frmAllocation.Visible = False Me.Caption = "Sample Size Calculator: State Level" stPage.Visible = True TabBar.value = 0 ElseIf value = SSC_StratumLevel Then lblWarn.Visible = True Me.Caption = "Stratum Level Allocation" Me.Height = 180 '********** 'App CRASHES HERE! stratPage.Visible = True TabBar.value = 1 End If End Property
Last edited by romperstomper; 06-20-2011 at 12:14 PM. Reason: code tags
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks