View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Dynamically adding ActiveX controls via VBA kills global VBA h

"Retains its value between calls" was the phrase I used. I thought by adding 1
to it each time the routine is run would be a good way to show that the value is
static. I guess it wasn't.

But if you put the assignment before the first use, you can't tell if its value
is what it is because of the assignment or because it retained its value.

The first time through Chip's routine Pub's value would be 0. Any future run
would show 12345 -- until the variable was reset (for some reason).

Sheeloo wrote:

Hello Dave,

First let me say that Chip is one of the Excel GODs as far as I am concerned.

I thought he wanted to show that value assinged IN the Sub does not change...

"Dave Peterson" wrote:

I don't think so.

Chip is showing that that since Pub is declared outside any Sub/function, it
retains its value between calls to the subroutine.


--

Dave Peterson