Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Focus is on wrong sheet after opening.

"Roger Govier" wrote in message
...
Hi

You could prevent the flicker with
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("the sheet to view on opening here").select
Application.ScreenUpdating = True
end sub


[snip]

After applying the above to the workbook, I still had that awful flicker.
Then it occurred to me (d'uh) to look at the rest of the code. I'm no vb
expert of course but I've created so many XL2K workbooks now with floating
toolbars that I'm more or less familiar with what elements should be there.
In the This Workbook module (correct word?), I had a count sheets code in.
I can't remember which workbook needed this but one did. Removed all that
extra stuff and the flickering stopped on its own. Crazy, huh? But I
managed to figure this out on my own, so I'm feeling pretty smug <lol.

Nevertheless, all this code is going into my Tips folder. It'll come in
handy at some point, I know.

Thanks once again for everyone's help. Much appreciated. :oD


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default Focus is on wrong sheet after opening.

Hi

Thanks for the feedback letting us know how you got on.
Well done for figuring out the cause of the problem, and solving it
yourself.

--
Regards

Roger Govier


"StargateFanFromWork" wrote in message
...
"Roger Govier" wrote in message
...
Hi

You could prevent the flicker with
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("the sheet to view on opening here").select
Application.ScreenUpdating = True
end sub


[snip]

After applying the above to the workbook, I still had that awful
flicker. Then it occurred to me (d'uh) to look at the rest of the
code. I'm no vb expert of course but I've created so many XL2K
workbooks now with floating toolbars that I'm more or less familiar
with what elements should be there. In the This Workbook module
(correct word?), I had a count sheets code in. I can't remember which
workbook needed this but one did. Removed all that extra stuff and
the flickering stopped on its own. Crazy, huh? But I managed to
figure this out on my own, so I'm feeling pretty smug <lol.

Nevertheless, all this code is going into my Tips folder. It'll come
in handy at some point, I know.

Thanks once again for everyone's help. Much appreciated. :oD




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Focus is on wrong sheet after opening.

"StargateFanFromWork" wrote in message
...

"Roger Govier" wrote in message
...
Hi

Thanks for the feedback letting us know how you got on.
Well done for figuring out the cause of the problem, and solving it
yourself.


<wry grin Turns out I'm still not so smart, though <sigh.


[snip]

Yet it's a toss-up. Do I leave the filtering and have an open,
corruptible environment ... or do I remove the filtering, leave all the
unprotect/protect codes in places before and after sorts but the user
can't filter at any of the columns at all. Tough, tough choice. [snip]


Had to pass along conclusions in case anyone else finds themselves in a
similar situation. I'm going to leave the ability to manually filter off.
I've again removed all the filtering code that caused the flickers in the
sheet upon opening. This was after trying the workbook again just now and
finding that even though the manual filters don't work at all, the ones in
the printing buttons do. They allow the sheet to be printed out 3 different
ways, one with all the entries, one with in-house training and another with
training done via outside sources. That's good enough, I believe, since
with fiscal year end there isn't much more I can do not having all the
knowledge needed to make such a complex thing work from all angles. If they
need anything more than that, I'll leave it to them to figure it out.

I will be paying attention to any posts in the archives again re filtering
protected sheets to see if I can learn anything more soon but in the
meantime at least we have the ability for those 3 reports above and that's
good. Since those are possible to do, it's more important now to leave the
protection codes** in place to keep
the book from being easily messed up.

(** I mean by that these 2 codes put at beginning and end of each various
commandbar macros to enable sorting, etc.:
ActiveSheet.Unprotect 'place at the beginning of the code
ActiveSheet.Protect ' place at end of code)

Thanks. All this helped. One learns so much this way even though it is a
tad frustrating. :oD


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Focus is on wrong sheet after opening.

On Tue, 27 Mar 2007 10:39:45 +0100, "Roger Govier"
wrote:

Hi

You need to stop screen updating at the start of the sub, then switch
back on at the end.


Did I put it in the anti-screene updating in the wrong place <lol

Private Sub Workbook_Open()
Dim I As Integer
Application.ScreenUpdating = False

For I = 1 To ThisWorkbook.Worksheets.Count
Worksheets(I).Activate
ActiveSheet.EnableAutoFilter = True
ActiveSheet.Protect UserInterfaceOnly:=True
Next I
Sheets("LAR Stats").Select

Application.ScreenUpdating = True

End Sub


Thanks. :oD
Reply
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
On opening a worksheet move focus to a cell based on date davcas Excel Worksheet Functions 1 July 1st 08 02:18 PM
Focus is on wrong sheet after opening. StargateFan[_3_] Excel Programming 0 March 25th 07 02:49 PM
HELP!! Unhide Sheet with Macro and focus on other sheet [email protected] Excel Discussion (Misc queries) 2 May 23rd 06 07:17 PM
Code Repeats Itself And Goes To Wrong Focus Minitman[_4_] Excel Programming 0 December 10th 04 06:17 PM
Wrong Macro opening oldjay Excel Programming 1 May 6th 04 03:07 PM


All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"