Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First off thanks to everyone here. I've come here many time with
questions and was able to find answers. And when I posted my question I've always got great help. Now I'm really stuck because it involves macros not running in a workbook I share, on someone else's pc. They get this error "Compile error: Can't find project or library. When I click debug this line gets highlighted wee1 = MsgBox("One of the worksheets you entered is incorrect. Please enter the names again" _ , vbExclamation) A coworker dimed this line then it worked. I have other msgboxes like this that i did not dim. The same goes for input boxes. and all of them are like this: Wks2 = InputBox("Enter the name of the worksheet that is to be sent to the stores") Again coworker dimed it as a string and it worked on his pc. All the while I never received an error message when running on my pc. This is not a pressing question, just a puzzling one for me. All help is greatly appreciated, and if more information is needed just let me know. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This probably happened due to the way you broke the line. This is how the
line should look: wee1 = MsgBox("One of the worksheets you entered is incorrect. Please enter the names again" , _ vbExclamation) Of course, due to the width limits of this forum window, the message was broken into two lines. To do that in code, you need ending apostrophes (") and "& _" to break strings into lines. HTH, Pflugs "Tsunami3169" wrote: First off thanks to everyone here. I've come here many time with questions and was able to find answers. And when I posted my question I've always got great help. Now I'm really stuck because it involves macros not running in a workbook I share, on someone else's pc. They get this error "Compile error: Can't find project or library. When I click debug this line gets highlighted wee1 = MsgBox("One of the worksheets you entered is incorrect. Please enter the names again" _ , vbExclamation) A coworker dimed this line then it worked. I have other msgboxes like this that i did not dim. The same goes for input boxes. and all of them are like this: Wks2 = InputBox("Enter the name of the worksheet that is to be sent to the stores") Again coworker dimed it as a string and it worked on his pc. All the while I never received an error message when running on my pc. This is not a pressing question, just a puzzling one for me. All help is greatly appreciated, and if more information is needed just let me know. Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the help. I did move the comma and still received the same
error on my coworkers pc. But without moving the comma and adding Dim wee1 As String my coworker was able to get the wee1 msgbox to work. But on my pc I don't need the dim statement. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check under tools-options editor tab require variable declaration
I would bet that it is checked on the coworker's pc and not on yours. I personally always dim everything. Peter Richardson "Tsunami3169" wrote: Thanks for the help. I did move the comma and still received the same error on my coworkers pc. But without moving the comma and adding Dim wee1 As String my coworker was able to get the wee1 msgbox to work. But on my pc I don't need the dim statement. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Pflugs, I found out that I'm not the only one that's had that problem. There were references that are located on my pc that ended up missing when someone else ran it on their pc. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sometimes not having all computers up-to-date with Office Service
Releases can cause strange behaviors. Just a thought. -- Regards, Bill Renaud |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
strange happenings with move/copy worksheet | Excel Worksheet Functions | |||
weird macro | Excel Programming | |||
Wierd VBA happenings... | Excel Discussion (Misc queries) | |||
Strange Happenings | Excel Discussion (Misc queries) | |||
Macro is weird! | Excel Programming |