Below is code for a form that emails from within excel. The code works great off my work station but when I upload it to the server that's on the network and run the form on the excel sheet it comes up with a compile error: "Can't find project or library"
Private Sub sendMsg_Click()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
On Error Resume Next
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = "chernandez@udi-flair.com"
.Subject = "Item Master FIMS Request"
.Body = Format(Frame2.Caption, ">") & vbNewLine & vbNewLine & "Please change the following... " & vbNewLine & vbNewLine & (TextBox1.Text) & " = CAT# CHANGE. " & vbNewLine & vbNewLine & _
Format(ComboBox1.Text) & " = ITEM CLASS. " & vbNewLine & (TextBox3.Text) & " = DESCRIPTION. " & vbNewLine & (ComboBox2.Text) & " = MAKE or BUY. " & vbNewLine & _
Format(ComboBox3.Text) & " = RCVNG INSPECTION. " & vbNewLine & (ComboBox4.Text) & " = INVENTORY TYPE. " & vbNewLine & (ComboBox5.Text) & " = ENGINEERING CATEGORY. " & vbNewLine & _
Format(ComboBox6.Text) & " = MSDS. " & vbNewLine & (ComboBox8.Text) & " = ASME. " & vbNewLine & (ComboBox15.Text) & " = SPARE PARTS. " & vbNewLine & vbNewLine & _
Format(Frame3.Caption, ">") & vbNewLine & vbNewLine & (Label16.Caption) & (Label27.Caption) & vbNewLine & (Label17.Caption) & (Label28.Caption) & vbNewLine & _
Format(Label18.Caption) & (Label29.Caption) & vbNewLine & (Label19.Caption) & (Label30.Caption) & vbNewLine & (Label20.Caption) & (Label31.Caption) & vbNewLine & _
Format(Label21.Caption) & (Label32.Caption) & vbNewLine & (Label22.Caption) & (Label33.Caption) & vbNewLine & (Label23.Caption) & (Label34.Caption) & vbNewLine & _
Format(Label24.Caption) & (Label35.Caption) & vbNewLine & (Label25.Caption) & (Label36.Caption) & vbNewLine & (Label26.Caption) & (Label37.Caption) & vbNewLine & vbNewLine & _
Format(Frame1.Caption, ">") & " = " & (TextBox2.Text) & ", System = " & (ComboBox9.Text) & vbNewLine & vbNewLine & _
Format(Frame4.Caption, ">") & vbNewLine & "LINE 1: " & (TextBox9.Text) & vbNewLine & "LINE 2: " & (TextBox11.Text) & vbNewLine & "Purchasing Notes = " & (TextBox10.Text) & vbNewLine & "Special Instructions = " & (TextBox12.Text) & vbNewLine & vbNewLine
.FlagRequest = "Item Master FIMS Request"
.Importance = olImportanceHigh
.Send
End With
Set objMail = Nothing
Set objOL = Nothing
cmdExit.SetFocus
End Sub
Thanks in advance for your time and support!
Private Sub sendMsg_Click()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
On Error Resume Next
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = "chernandez@udi-flair.com"
.Subject = "Item Master FIMS Request"
.Body = Format(Frame2.Caption, ">") & vbNewLine & vbNewLine & "Please change the following... " & vbNewLine & vbNewLine & (TextBox1.Text) & " = CAT# CHANGE. " & vbNewLine & vbNewLine & _
Format(ComboBox1.Text) & " = ITEM CLASS. " & vbNewLine & (TextBox3.Text) & " = DESCRIPTION. " & vbNewLine & (ComboBox2.Text) & " = MAKE or BUY. " & vbNewLine & _
Format(ComboBox3.Text) & " = RCVNG INSPECTION. " & vbNewLine & (ComboBox4.Text) & " = INVENTORY TYPE. " & vbNewLine & (ComboBox5.Text) & " = ENGINEERING CATEGORY. " & vbNewLine & _
Format(ComboBox6.Text) & " = MSDS. " & vbNewLine & (ComboBox8.Text) & " = ASME. " & vbNewLine & (ComboBox15.Text) & " = SPARE PARTS. " & vbNewLine & vbNewLine & _
Format(Frame3.Caption, ">") & vbNewLine & vbNewLine & (Label16.Caption) & (Label27.Caption) & vbNewLine & (Label17.Caption) & (Label28.Caption) & vbNewLine & _
Format(Label18.Caption) & (Label29.Caption) & vbNewLine & (Label19.Caption) & (Label30.Caption) & vbNewLine & (Label20.Caption) & (Label31.Caption) & vbNewLine & _
Format(Label21.Caption) & (Label32.Caption) & vbNewLine & (Label22.Caption) & (Label33.Caption) & vbNewLine & (Label23.Caption) & (Label34.Caption) & vbNewLine & _
Format(Label24.Caption) & (Label35.Caption) & vbNewLine & (Label25.Caption) & (Label36.Caption) & vbNewLine & (Label26.Caption) & (Label37.Caption) & vbNewLine & vbNewLine & _
Format(Frame1.Caption, ">") & " = " & (TextBox2.Text) & ", System = " & (ComboBox9.Text) & vbNewLine & vbNewLine & _
Format(Frame4.Caption, ">") & vbNewLine & "LINE 1: " & (TextBox9.Text) & vbNewLine & "LINE 2: " & (TextBox11.Text) & vbNewLine & "Purchasing Notes = " & (TextBox10.Text) & vbNewLine & "Special Instructions = " & (TextBox12.Text) & vbNewLine & vbNewLine
.FlagRequest = "Item Master FIMS Request"
.Importance = olImportanceHigh
.Send
End With
Set objMail = Nothing
Set objOL = Nothing
cmdExit.SetFocus
End Sub
Thanks in advance for your time and support!