LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default First Aid For Macros


I had (fortunately, not have) a sick macro (at least I think HAD). Whe
opening, and when saving, the workbook containing the macro, I receive
"Compile error: Invalid outside procedure" -- on the same screen,
range name or a cell location in the coding would be highlighted.
Also, when doing Alt+{F8}, the name of the macro with the problem di
NOT appear; furthermore, the other 12 macros listed had the file nam
plus the Module number preceding each macro name.

My solution was to copy the macro contents to the Clipboard, delete al
of the text in the problem macro, and then save the workbook. I the
re-opened the workbook (this time there was no problem). I the
created a new macro, re-named it, pasted the text from the Clipboard
and then saved the workbook.

I have two theories as to what happened:

As I said above, 13 macros; all but one (not the problem macro) of the
are connected, maybe a 1,000 lines of code. Somehow, I have about 8
Modules; I have made numerous macro edits -- I did nothing else that
am aware of to create these Modules. Is this a problem?

Secondly, I have 3 MsgBoxes in these macros (2 of them are in th
problem macro), each containing Yes and No buttons. Each has th
following line of code: Dim Msg, Style, Title, Response. I think whe
I had created only 2 of these boxes, the compiler did not have
problem. But, when I created the third, the compiler definitely had
problem -- I deleted one or two of the Dim lines and everythin
appeared to work OK.

I also had two Dim Target as Range lines, each involving only two line
of code: Target.FormulaR1C1 = ... ; and Target.Value = Target.Value (
think both of these Dim lines are in the same macro, but not th
problem one); the compiler forced me to delete one of these Dim lines.

Are my Dim lines a problem? I would like to create one more MsgBox.

Any help would be appreciated.

Chuckles12

--
Chuckles12
-----------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...fo&userid=1494
View this thread: http://www.excelforum.com/showthread.php?threadid=26631

 
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
convert lotus 123w macros to excel macros rpiescik[_2_] Excel Programming 1 September 19th 04 12:41 PM
convert lotus 123w macros to excel macros rpiescik Excel Programming 1 September 18th 04 01:35 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
Macro Size Limit / open macros with macros? andycharger[_7_] Excel Programming 6 February 13th 04 02:00 PM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM


All times are GMT +1. The time now is 01:20 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"