MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 25th, 2002, 12:41 PM   #1
CesarH
New Member
 
Join Date: Mar 2002
Posts: 3
Default

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!
CesarH is offline   Reply With Quote
Old Mar 25th, 2002, 12:52 PM   #2
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

Hi

I can test the code as not my server and so on.. but soon as this kinda code is on such systems problem can occur, million of reasons.

I would write and load from residant PC or if needs be server, then should be ok.

Ermm thinking....... who do i say a printer configured on Win95 over Novel will bounce out if straight file print to printer Q2Jack is chosen , see the network calls this printer S2Jack to VBA fill fail

Does this make sence? So the codes need to be whatthe server knows not the PC log on and so on....

Does that help....

I can fix as cant see the set up hands on... need advice from IT Dept
__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Mar 25th, 2002, 01:41 PM   #3
CesarH
New Member
 
Join Date: Mar 2002
Posts: 3
Default

Thanks for your quick reply! I solved part of my problem but the still have another challenge.

I changed the first line from:

Private Sub sendMsg_Click()

To:

Public Sub sendMsg_Click()

This works great on the network only on regular WIN9X stations. The challenge is still there with the complie error on the NT stations. If anyone has any suggestions please reply.

Thanks for your support!!
Cesar
CesarH is offline   Reply With Quote
Old Mar 25th, 2002, 04:08 PM   #4
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

Good stuff now run Debug in VBE and see where it stopps that the code error.... highlighted..


__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Mar 25th, 2002, 06:16 PM   #5
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Hi,

Are you still getting the missing library error?

Have you checked your references?

Probably need to remap a reference or two.

Click on Tools, References in VBA environment.

Your reference is probably WindowsSystem
or
WindowsSystem32

It need to be changed to WINNTSystem
or
WINNTSystem32

Tom

[ This Message was edited by: TsTom on 2002-03-25 17:19 ]
Tom Schreiner is offline   Reply With Quote
Old Mar 25th, 2002, 08:15 PM   #6
CesarH
New Member
 
Join Date: Mar 2002
Posts: 3
Default

Tom:

Thanks for your reply! The problem still exists on the NT stations. I did check and change reference library to reflect the Microsoft Outlook 9.0 Object library. How do I set the paths in code to reflect both Object libraries for the WIN9X & WINNT stations??

Thanks in advance for your time and support!!!

Cesar
CesarH is offline   Reply With Quote
Old Mar 25th, 2002, 10:09 PM   #7
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Hi
I don't really know?
There may be a more sophisicated way, but one way would be to trap the error and handle it in a routine.
For instance, set the default path for the operating system you use most frequently. When you get a run-time error, trap the error, check the err.number and try the other path, then Resume Next.
That would work.
Tom Schreiner is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:45 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes