VBA Userform Displaying Errors For Some Users and Not Others

mike90

New Member
Joined
Jun 2, 2011
Messages
16
Hello all,

I have created a simple UserForm that basically dumps information entered into the form into a worksheet.

It has been working fine for around 2/3 months until now - a compile error message comes up when hitting the enter command button stating "Cannot Find Project Or Library", however there has been no change whatsoever to the coding and only occurs on certain machines / profiles.

I have no idea what is causing this!! Please help!?

Kindest Regards

Mike
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Have these machines where the error occurs been able to use it without error before?
Has anything changed on these machines? (new Windows version? new Office version? ...)
 
Upvote 0
yes they have been using it for the past 2/3 months without any problems - and as far as im aware nothing has been updated or changed.

I have spoken with my colleague who has informed that they have circular references in use on other worksheets and so has Iterative calculations enabled, however this does not relate to the UserForm

dont know if that helps?
 
Upvote 0
Does the workbook contain references to other Office apps or non-standard controls? If so, I suspect a windows/office update has broken something, or you are not all on the same version.
 
Upvote 0
It does contain a reference to Outlook, in which it generates an email to be sent if the data contains a specified value.

All the machines run on 2007 and no updates have been installed - as far as im aware.
 
Upvote 0
Which reference is shown as MISSING: on the machine(s) with the problem?
 
Upvote 0
Not too sure what reference is missing - when the debugger runs it highlights:

Public Sub CommandButton1_Click()

Full Code:

Public Sub CommandButton1_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("PartsData")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtJobNo.Value) = "" Then
Me.txtJobNo.SetFocus
MsgBox "Please enter a job number"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 1).Value = Format(Me.txtDate.Value, "mm-dd-yyyy")
ws.Cells(iRow, 2).Value = Me.txtJobNo.Value
ws.Cells(iRow, 3).Value = Me.txtCusRef.Value
ws.Cells(iRow, 4).Value = Me.txtTOC.Value
ws.Cells(iRow, 5).Value = Me.txtTOB.Value
ws.Cells(iRow, 6).Value = Me.txtJourney.Value
ws.Cells(iRow, 7).Value = Me.txtIncident.Value
ws.Cells(iRow, 8).Value = Me.txtResolution.Value
ws.Cells(iRow, 9).Value = Me.cboType.Value
ws.Cells(iRow, 10).Value = Me.cboBy.Value
ws.Cells(iRow, 11).Value = Me.cboTo.Value
ws.Cells(iRow, 12).Value = Me.cboCus.Value
ws.Cells(iRow, 13).Value = Me.cboSup.Value

'email notifications depending on type
Dim olapp As Outlook.Application
Dim olmail As MailItem
Set olapp = New Outlook.Application
Set olmail = olapp.CreateItem(olMailItem)
If Me.cboType = "T1" Then
With olmail
.To =
.CC =
.Subject = "T1 Case Raised"
.Body = "Job Number" + ", " + txtJobNo.Value + ", " + txtIncident.Value + ", " + txtResolution.Value + ", " + cboSup.Value + ", " + cboCus.Value
.Display
End With
Set olmail = Nothing
Set olapp = Nothing
End If

'clear the data
Me.txtDate.Value = ""
Me.txtJobNo.Value = ""
Me.txtCusRef.Value = ""
Me.txtTOC.Value = ""
Me.txtTOB.Value = ""
Me.txtJourney.Value = ""
Me.txtIncident.Value = ""
Me.txtResolution.Value = ""
Me.cboType.Value = ""
Me.cboBy.Value = ""
Me.cboTo.Value = ""
Me.cboCus.Value = ""
Me.cboSup.Value = ""
Me.txtDate.SetFocus
End Sub
 
Upvote 0
You have to check Tools-References in the VBEditor on the machine with the problem.
 
Upvote 0
Do you actually use that? If not, uncheck it and save the workbook.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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