View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alan Alan is offline
external usenet poster
 
Posts: 188
Default How do I access a variable from another instance of excel?


Hi All,

I have the following situation (simplified for this posting):

I have created a new instance of excel which is performing some
actions
that take a few minutes. I would like to have a variable (just an
integer or string perhaps - doesn't really matter which) that is
updated in that instance that I can then access from the first
application object to give the user progress information.

Example:

In the main application:

NewExcel is an Excel.application object (new)

I would like to be able to do something like this:

Application.Statusbar = NewExcel.ProgressCounter


Within the NewExcel Application:

Sub CodeStuff()

Dim ProgressCounter as Integer

Rem Start of code

Rem Do stuff

ProgressCounter = 1

Rem Do more stuff

ProgressCounter = 2

Rem Blah Blah

End Sub




Within the main application, the statusbar would be showing 1, 2, 3
etc as the NewExcel application make progress.

However, I cannot work out how to access the value of ProgressCounter
from within the main excel application - any ideas?

Hope that makes sense!

Thanks,

Alan.