View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Leon[_2_] Leon[_2_] is offline
external usenet poster
 
Posts: 25
Default Prevent multiple workbooks in same Excel instance

The ontime loops and starts same sub every minute.
The code shifts sheets - managing data - updates graphs - and stuff.
Finally set focus at the sheet that was active when the ontime
started.

I have tried to put "thisworkbook" all places needed - but maybe I
missed something.

I did succeeded making the code so that it do not break with an End/
debug question, but the code bring the workbook1 in front when the
code stops and places focus at the sheet that was active in the
workbook1 at the time the ontime started.

Is it possible to make ontime fool around in workbook1 and at the same
time a user can work with another workbook2 not being disturbed by tha
workbook1 macro that starts every minute?



On 17 Sep., 17:49, Gord Dibben <gorddibbATshawDOTca wrote:
What happens to the ontime code when you open another workbook?

Gord Dibben *MS Excel MVP

On Thu, 17 Sep 2009 01:10:17 -0700 (PDT), Leon
wrote:



Hi


I have a workboook which is updated every minute by using the ontime
facility.
It works fine when user not have any other workbook open in the same
intance of Excel.


How do I prevent user from open another workbook in the particular
instance containing the workbook with autoupdate function (ontime)


1) when user tries to open another workbook via the open menu
2) when user dobbleclick on an xls file


Regards- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -