Code that worked perfectly before now gives an "Application Defined or Object Defined Error"

Gideon du Toit

New Member
Joined
May 22, 2023
Messages
29
Office Version
  1. 2010
Platform
  1. Windows
My MS Office 2010 Installation recently got corrupted, so I reinstalled it. Since then I have been getting errors on code that use to run just fine. I cant for the life of me see anything wrong with the code, as it has been part of this VBA application that I have been busy developing for months. Now everything seems messed up.

I have included hereunder one of these instances, where code that ran and executed perfectly before is now giving an "Application Defined or Object Defined Error". (1004)

The Error occurs in each of the lines trying to assign a value to a cell on Sheet4 from a textbox on a form. The code below is in a Module and it ran perfectly before, as it has been for months.

VBA Code:
Private Sub cmdUpdate_Click()

'Calculate Actuals
If cmbMonth.Value <> "" Then
Call Calculate_Actuals
End If

'Baseline Calculations
'Update Expenses
Sheet4.Range("D6").Value = CCur(txtFac.Text)
Sheet4.Range("D7").Value = CCur(txtVen.Text)
Sheet4.Range("D8").Value = CCur(txtPri.Text)
Sheet4.Range("D9").Value = CCur(txtEqi.Text)
Sheet4.Range("D10").Value = CCur(txtDat.Text)
Sheet4.Range("D11").Value = CCur(txtOOOther.Text) 'Other on Random and Once Off Costs
Sheet4.Range("D12").Value = CCur(txtAss.Text)
Sheet4.Range("D13").Value = CCur(txtMod.Text)
Sheet4.Range("D14").Value = CCur(txtOth.Text) 'Miscellaneous
Sheet4.Range("D15").Value = CCur(txtCourier.Text)
Sheet4.Range("D16").Value = CCur(txtFood.Text)
Sheet4.Range("D17").Value = CCur(txtTravel.Text)
Sheet4.Range("D18").Value = CCur(txtCon.Text)
Sheet4.Range("D19").Value = CCur(txtInduct.Text)
Sheet4.Range("D20").Value = CCur(txtCancel.Text)
Sheet4.Range("D21").Value = CCur(txtTabs.Text)
Sheet4.Range("D22").Value = CCur(txtDriver.Text)

'Save Frequencies
Call SaveFrequencies
Call Fac_Expense
Call Venue_Expense
Call Printing_Expense
Call Equipment_Expense
Call Data_Expense
Call Assessor_Expense
Call Moderator_Expense
Call Miscellaneous_Expense
Call Food_Expense
Call Travel_Expense
Call Consumables_Expense
Call Other_Expenses
Call Courier_Expenses
Call Cancelation_Expenses
Call Tablets_Expenses
Call Driver_Expenses
Call Induction_Expenses

Sheet4.Range("C4").Value = CCur(Application.WorksheetFunction.Sum(Range("C6:C22")))

intProjectDays = 0
intLearnerNumber = 0
intProjectClasses = 0

strLogEvent = "Baseline was calculated"
Call Log_Event

Unload frmBudget

End Sub
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Presumably the worksheet is not protected?
 
Upvote 0
Solution

Forum statistics

Threads
1,215,079
Messages
6,123,000
Members
449,092
Latest member
masterms

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top