Gideon du Toit
New Member
- Joined
- May 22, 2023
- Messages
- 29
- Office Version
- 2010
- Platform
- 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.
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