#16
|
||||
|
||||
Ah, excellent! Thanks, Paul.
("Ho, hum"—lol) |
#17
|
|||
|
|||
Thanks! Macropod's last coding did exactly what I wanted it to. I had to remove "ThisWorkbook." from MacroName and then it ran like a charm! Sorry about the delay in responding; there's been some rough weather in my part of the country recently!
|
#18
|
||||
|
||||
Whilst it might work well enough without "ThisWorkbook.", you still should reference the workbook from which the code is to be run, so you don't run into problems when multiple workbooks are open and: (a) the macro you want to run isn't in the active workbook; and/or (b) there is more than one sub of the same name in the different workbooks.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#19
|
||||
|
||||
I'm with macropod on this; every time I get into the habit of using unqualified objects, I end up shooting myself in the foot and go back to qualifying everything. Well, almost everything.
On the other hand, this problem tends to be self-correcting. Some day, maybe soon, you'll spend a frustrating hour or whole afternoon trying to figure out why something really simple is producing the wrong results. When you realize what it is, you'll remember what we said. One or two of those and I expect you'll decide it's worth the extra work. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
object variable or with block variable not set | MJP143 | Excel | 1 | 02-11-2013 05:07 AM |
Run-time error '91': Object variable or With block variable not set | tinfanide | Excel Programming | 2 | 06-10-2012 10:17 AM |
excel where is procedure being called from | davids67 | Excel Programming | 1 | 11-18-2011 06:48 AM |
What is this symbol called as? | Franky | Word | 3 | 11-12-2011 08:16 AM |
What is this right-click sub-menu called? | wornways | Word | 3 | 08-13-2010 09:17 PM |