Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2007. I have a workbook that has a lot of VBA modules behind it. This
workbook has opened and all the code has functioned quite nicely under Excel 2003 for years. Now some of the most basic stuff is bombing. In particular, in the workbooks startup code I am getting the following error on this line of code: Sheets("Main Menu").PayrollCompare.Enabled = True Run-time error '1004' Unable to set the enabled property of the OLEObject class. When I go into debug when the error occurs, I find that I get the error on any of the objects that DO reside on the worksheet named "Main." All of these objects exist on the sheet. Below is the startup routine that has worked for years. By the way, I thought it might be just a memory issue (as I had only 512 MB). I just upgraded to 2 GB and I still get the error. Any help of suggestion would be greatly appreciated. God bless. Private Sub Workbook_Open() 'GoTo tend Sheets("Main Menu").Activate Sheets("Main Menu").ScrollArea = "E7" 'Disable all buttons until initialization is complete. 'Make all sheets except Main invisible until init complete Sheets("Income Statements").Visible = False Sheets("Detail Reports").Visible = False Sheets("Budgets").Visible = False Sheets("Payroll Compare").Visible = False Sheets("Payroll ACH").Visible = False Sheets("Main Menu").IncomeStatements.Enabled = False Sheets("Main Menu").DetailReports.Enabled = False Sheets("Main Menu").Budgets.Enabled = False Sheets("Main Menu").PayrollCompare.Enabled = False Sheets("Main Menu").PayrollACH.Enabled = False Sheets("Main Menu").Setup.Enabled = False Sheets("Main Menu").ExitButton.Enabled = False 'Open status form and initialize completion boxes StartupStatus.CheckBox1.Value = False StartupStatus.CheckBox2.Value = False StartupStatus.CheckBox3.Value = False StartupStatus.Show 0 'Check to see if Express ClickYes is Running If Not fIsProcessRunning("C:\Program Files\Express ClickYes\ClickYes.exe") Then If Dir("C:\Program Files\Express ClickYes\ClickYes.exe") = "" Then MsgBox "Express ClickYes is not installed on your system." + Chr(10) + "This will affect sending email from the switchboard." + Chr(10) + "Contact your system administrator to have ClickYes installed.", vbInformation, "Express ClickYes Not Installed" Else Shell ("C:\Program Files\Express ClickYes\ClickYes.exe") End If End If StartupStatus.CheckBox1.Value = True Application.ScreenUpdating = False Sheets("Contacts").Activate Call GetAllAddresses StartupStatus.CheckBox2.Value = True Sheets("Main Menu").Activate ThisWorkbook.Sheets("Budgets").OtherRecipient.List FillRange = "Contacts!A3:A" + Trim(ThisWorkbook.Worksheets("Contacts").Cells(1, 1)) ThisWorkbook.Sheets("Income Statements").OtherRecipient.ListFillRange = "Contacts!A3:A" + Trim(ThisWorkbook.Worksheets("Contacts").Cells(1, 1)) ThisWorkbook.Sheets("Detail Reports").OtherRecipient.ListFillRange = "Contacts!A3:A" + Trim(ThisWorkbook.Worksheets("Contacts").Cells(1, 1)) 'Update the Project Definitions sheet Call Update_Projects_Information StartupStatus.CheckBox3.Value = True 'Make sure only one sheet is created in new workbooks Application.SheetsInNewWorkbook = 1 'Delay before removing status form Call WaitIt(2) StartupStatus.Hide 'Enable all buttons 'Make all sheets visible Sheets("Income Statements").Visible = True Sheets("Detail Reports").Visible = True Sheets("Budgets").Visible = True 'Only allow privileged users to access payroll functions If PrivUser(Environ("UserName")) Then Sheets("Main Menu").PayrollCompare.Enabled = True Sheets("Main Menu").PayrollACH.Enabled = True Sheets("Payroll Compare").Visible = True Sheets("Payroll ACH").Visible = True Else Sheets("Main Menu").PayrollCompare.Enabled = False Sheets("Main Menu").PayrollACH.Enabled = False Sheets("Payroll Compare").Visible = False Sheets("Payroll ACH").Visible = False End If Sheets("Main Menu").IncomeStatements.Enabled = True Sheets("Main Menu").DetailReports.Enabled = True Sheets("Main Menu").Budgets.Enabled = True Sheets("Main Menu").Setup.Enabled = True Sheets("Main Menu").ExitButton.Enabled = True Application.ScreenUpdating = True tend: End Sub -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 SP1 - How to do F9 in VBA code? | Excel Discussion (Misc queries) | |||
Excel bombs out in macro...help please!! | Excel Programming | |||
Code bombs at line indicated, why? | Excel Programming | |||
sumproduct bombs out | Excel Worksheet Functions | |||
Macro runs in Excel 2003, bombs in XP - Compatability question | Excel Programming |