Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > VB Refresh Worksheet Function?


Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2004, 08:08 PM
jamesmoore1's Avatar
jamesmoore1 jamesmoore1 is offline
Regular
 
Join Date: Jan 2004
Location: Atlanta, GA
Posts: 55
Default VB Refresh Worksheet Function?


Is there a way to visually "refresh" a worksheet each time it selected? (not refresh as it applies to pivot tables, etc..)

The issue I am having is that, only in full screen mode, I have two worksheets with VB control buttons on them. I can flip back and forth (using another control) to view page1/page2/page1 etc... After a few times of going back and forth, the area where the control buttons are goes blank(light grey) and nothing can be selected. If I toggle full screen off/on the buttons come back immediately... so I am wondering if there is anything that can be done. I know full screen is a tempermental beast and the user can get by without it, but its sooo nice to have the worksheet in full view on fullscreen.

Any ideas?
Reply With Quote
  #2  
Old 02-26-2004, 08:44 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Huh, I've not experienced this. Not even 100% sure that I understand. Maybe you're running low on memory resources? Does this happen on other PC's if you run it?

Why is FullScreen a "temperamental beast"? I may just not have enough experience with it, I guess, but in what other circumnstances have you noticed problems? (This is just for my own curiousity, if you can think of anything off the top of your head.)

As for your current problem, other than more memory (which may not cure it, but it's still my best guess), I have no other ideas, unfortuantely.

I tried putting this in the 'ThisWorkbook' module:
Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object) Application.ScreenUpdating = False Application.DisplayFullScreen = Not Application.DisplayFullScreen Application.DisplayFullScreen = Not Application.DisplayFullScreen Application.ScreenUpdating = True End Sub
But it creates a noticeable and annoying blink. I was trying to implement the fix you found (programmatically) but it is a failure.

Sorry I can't do better...

-- Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #3  
Old 02-26-2004, 09:01 PM
jamesmoore1's Avatar
jamesmoore1 jamesmoore1 is offline
Regular
 
Join Date: Jan 2004
Location: Atlanta, GA
Posts: 55
Default

I had hoped it was only on my PC and found out today that my boss had the same problem... thank god I put a Ctrl+ shortcut to a fullscreen toggle that I had created. I'm not discounting that it could be a memory issue, but with 340MB of memory and nothing else running I would hope that I'm not tapped out.

The fullscreen beast comment stemmed from another post I read on the board recently wondering about peoples facination with FullScreen and how if something goes wrong you can really screw up someones computer. I learned this first hand when I was first playing around with FullScreen as well as disabling the standard menu bar at the top so that you basically had a blank screen... until I figured out how to undo that, I lost my worksheet menu bar in excel. Rookie mistake, yes...but it illustrated the point. Here is the code that I use to toggle fullscreen on and off plus hide the menu and command bars.

Code:
Private Sub CmdBtn_FullScrnOff_Click() ActiveWorkbook.Unprotect Application.CommandBars("Worksheet Menu Bar").Enabled = True Application.CommandBars("Full Screen").Enabled = True Application.DisplayFullScreen = False End Sub Private Sub CmdBtn_FullScrnOn_Click() Application.CommandBars("Worksheet Menu Bar").Enabled = False Application.DisplayFullScreen = True Application.CommandBars("Full Screen").Enabled = False ActiveWorkbook.Protect Structure:=False, Windows:=False End Sub

This is what I meant by fullscreen...EVERYTHING gone. The VB command buttons dissapear after flipping back and forth between the two pages that have them on there. Interestingly... command buttons for macros that Excel has, are not affected by this. hmmmm

Do you know what I am talking about now?
Reply With Quote
  #4  
Old 02-26-2004, 09:12 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

I think it mostly, but don't quite get where or what these buttons are... Are the "VB command buttons" on the Worksheet? Or are they CommandBarButtons on a CommandBar (sounds like you've hidden all CB's though).

If it's on a Worksheet, are these buttons from the "Controls Toolbox" CommandBar or from the "Forms" CommandBar?

-- Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #5  
Old 02-26-2004, 09:18 PM
jamesmoore1's Avatar
jamesmoore1 jamesmoore1 is offline
Regular
 
Join Date: Jan 2004
Location: Atlanta, GA
Posts: 55
Default

They are on the worksheet and came from the control toolbox...they are needed because of the way I have to view the worksheet, the text size on the forms CBs cannot be increased. With the control toolbox CBs, I can format them as if they were on a userform, which solves my problem when the sheet is zoomed out at normal viewing range in order to read the text on the buttons
Reply With Quote
  #6  
Old 02-26-2004, 09:29 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Ok, so it sounds like using buttons from the Forms CommandBar is not practical.

But just for kicks you may want to add one to the Worksheet, see if it does the same thing. If they do not exhibit the same behaviour then you may have a decision to make.

Others may have other ideas, but best I can tell, this is a bug or a memory issue. So you're really going to have to push & pull and stretch the boudaries a bit her and see if you can find some other quirk that you can take advantage of.

Btw, you're not on XL'97 are you?

-- Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #7  
Old 02-26-2004, 10:09 PM
jamesmoore1's Avatar
jamesmoore1 jamesmoore1 is offline
Regular
 
Join Date: Jan 2004
Location: Atlanta, GA
Posts: 55
Default

Nope using OfficeXP
the CBs from the forms toolbar don't behave the same way... unless someone else has a better idea, I'm probably just going to comment out the section that hides the worksheet menu bar... that seems to be the fly in the ointment... Works fine with that * * * * menu bar at the top LOL.
Thanks for the brainstorming though
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding the handle of a combo-box list. meteo API 4 02-20-2004 11:20 AM
need help! i'm a beginner geekool General 7 04-26-2003 12:44 AM
QB to VB Conversion - By AIO BillSoo Tutors' Corner 0 08-06-2002 11:37 AM
MS Winsocket gibson General 3 07-20-2001 10:03 AM
link function to textboxes golash General 2 05-03-2001 11:57 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->