starl
Administrator
- Joined
- Aug 16, 2002
- Messages
- 6,081
- Office Version
- 365
- Platform
- Windows
I've been rewriting a workbook written by someone else many years ago. I have never run into this error before and can't figure out what it's talking about:
In the ThisWorkbook module, I have a Workbook_Open event. Within it, it calls function InitMe.
If the function is Public, I get the error in the title when I compile
If I make the function Private, the error goes away.
I don't program within the book/sheet modules that much, except events. I've occasionally had events call other subs/functions, often stored in standard modules, not within the same special module. So I thought maybe this was a rule I had not run into (after xx years of programming, but you never know!) So, I created another workbook with an Open event and a call to a public function in the same module. No error.
Any idea what's going on? It's not a problem leaving it Private, but I'm just wondering why this workbook is acting this way.
Update: there's another function call in the Open and that function is Public without a problem...
In the ThisWorkbook module, I have a Workbook_Open event. Within it, it calls function InitMe.
If the function is Public, I get the error in the title when I compile
If I make the function Private, the error goes away.
I don't program within the book/sheet modules that much, except events. I've occasionally had events call other subs/functions, often stored in standard modules, not within the same special module. So I thought maybe this was a rule I had not run into (after xx years of programming, but you never know!) So, I created another workbook with an Open event and a call to a public function in the same module. No error.
Any idea what's going on? It's not a problem leaving it Private, but I'm just wondering why this workbook is acting this way.
Update: there's another function call in the Open and that function is Public without a problem...