C
Chuckles123
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
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