LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Event macro does not run a Private sub

Bob
Do you have that right? I have the following in my HowTo file:
"You don't need to put private in front of each sub. You can type Option
Private Module at the top of the module and all the macros within that
module will be Private."
What you are saying seems to be the opposite except for the "visible" part.
Thanks for your time. Otto
"Bob Phillips" wrote in message
...
Or add

Option Private Module

to the module declaration, it will then be exposed to all modules, but not
'seen' from Excel.

--
__________________________________
HTH

Bob

"Otto Moehrbach" wrote in message
...
Chip
Thanks for that. There is no end to this learning thing. I thought
"Private" simply hid that macro from the Tools - Macro - Macros list.
I'll go back to passing a dummy value to hide the macro. Thanks again.
Otto
"Chip Pearson" wrote in message
...
The Private declaration indicates that the procedure is not visible to
code outside the module in which the procedure is defined. So, if you
have UpdateAll in a module other than the ThisWorkbook module and it
is marked Private, it won't be found. When you use neither Public nor
Private in a regular code module, Public is the default.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Sat, 18 Oct 2008 17:44:40 -0400, "Otto Moehrbach"
wrote:

Excel XP & Win XP
I have a simple BeforeSave macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Call UpdateAll
End Sub

The UpdateAll macro is a Private macro as:
Private Sub UpdateAll()
'Stuff
End Sub

The event macro errored out as not being able to find the sub. When I
removed the "Private" in the first line of the UpdateAll macro, it
worked
fine.
Why is that? Thanks for your time. Otto







 
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
Improve method of calling a private function in a private module XP Excel Programming 1 April 30th 08 06:41 PM
Private Sub Workbook_Open() event won't fire if workbook is hidden? Mike Weaver Excel Programming 2 February 15th 06 01:38 PM
Public, Private, Event modules, Forms modules,,, Jim May Excel Programming 11 October 31st 05 03:12 AM
re : Possible to run private sub macros by writing another private ddiicc Excel Programming 5 August 26th 05 04:49 AM
Private Sub Running Other Private Sub Inadvertently Ross Culver Excel Programming 2 February 10th 05 07:17 PM


All times are GMT +1. The time now is 10:22 AM.

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"