Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Weird Macro Happenings

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Weird Macro Happenings

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Weird Macro Happenings

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Weird Macro Happenings

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Weird Macro Happenings


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Weird Macro Happenings

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
strange happenings with move/copy worksheet Don Excel Worksheet Functions 1 May 3rd 08 07:26 PM
weird macro SteveDB1 Excel Programming 16 September 5th 07 02:36 AM
Wierd VBA happenings... LT Excel Discussion (Misc queries) 4 March 15th 07 02:10 PM
Strange Happenings Alan Excel Discussion (Misc queries) 7 June 20th 06 08:15 PM
Macro is weird! toolroomman Excel Programming 4 August 29th 05 09:49 PM


All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"