View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Pfister Bill Pfister is offline
external usenet poster
 
Posts: 132
Default How to get known by which application Excel was launched?

If you only have a single instance at any given time, you can set a status
flag in the registry. Before an application calls / opens excel, set the
registry key to "pending" (or some equivalent), then the workbook code can
check the registry value (in addition to looking for the named range). When
you've completed operations, set the registry key "complete".

If you had multiple instances running, you can use a queue (via ini or log
file, or in the registry) that keeps track of all your requests and updates
the queue when the requested operations are completed.

Bill



"Sergiy" wrote:

Dear Colleagues,

I am trying to automate some reports fuctionality by excel macro and I
need to avoid double processing for the expored data .

I wrote add-in excel modute to hook the workbook open event. Than if it
found certain named range it processing exported data.

The problem is that my macro runs every time when workbook with this
named range opens and performs data processing and so modify some
important data (for example when report was created).

I need some marker to get know that this workbook was updated by main
programm and need to be processed.

Or I need to get know that excel was started by main application and
perform data processing in this case and ignore all other cases.

Do you have any Idea how it can be implemented?