redraw thing

So my Excel app has VBA code that does a long file read and update
operation. This can take up to one hour. And the client wants it to
show a "please wait" message while it is doing this to help assure
that it isn't just hung.

So I added a non-modal user form with the message. Put it up on the
screen before the work starts, and unload it again after the work is
done.

My problem is, the form does not finish redrawing before the work
starts. And by then, Excel is sucking all the CPU doing the work, so
the form does not redraw. It shows an empty frame the entire time.
Which just makes it look more like things have hung rather than less.

So: What do folks do to show a "please wait" message during long
operations?
socks
0
puppet_sock (108)
3/19/2012 2:45:33 PM
excel 39880 articles. 2 followers. Follow

3 Replies
834 Views

Similar Articles

[PageSpeed] 48

A single line:  DoEvents
....after the form is shown but before your "work" starts.

Also beneficial when trying to get messages boxes to go away.
-- 
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(List Files XL add-in:  finds and lists files/folders with hyperlinks)





"Puppet_Sock" <puppet_sock@hotmail.com>
wrote in message
news:cb858315-2a65-4186-93ca-f654565a9b23@i2g2000vbv.googlegroups.com...
> So my Excel app has VBA code that does a long file read and update
> operation. This can take up to one hour. And the client wants it to
> show a "please wait" message while it is doing this to help assure
> that it isn't just hung.
>
> So I added a non-modal user form with the message. Put it up on the
> screen before the work starts, and unload it again after the work is
> done.
>
> My problem is, the form does not finish redrawing before the work
> starts. And by then, Excel is sucking all the CPU doing the work, so
> the form does not redraw. It shows an empty frame the entire time.
> Which just makes it look more like things have hung rather than less.
>
> So: What do folks do to show a "please wait" message during long
> operations?
> socks 


0
3/19/2012 3:15:57 PM
Puppet_Sock was thinking very hard :
> So my Excel app has VBA code that does a long file read and update
> operation. This can take up to one hour.

Geez, the file must be 10s of kigabytes in size OR you're doing it the 
slow way for whatever reason you may have against a more efficient 
approach!

-- 
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
    comp.lang.basic.visual.misc
    microsoft.public.vb.general.discussion


0
gs3102 (378)
3/19/2012 4:02:17 PM
On Mar 19, 11:15=A0am, "Jim Cone" <james.cone...@comcast.netXxx> wrote:
> A single line: =A0DoEvents
> ...after the form is shown but before your "work" starts.
>
> Also beneficial when trying to get messages boxes to go away.

Thanks Jim! That was exactly what I needed.
Socks
0
puppet_sock (108)
3/23/2012 6:22:28 PM
Reply:

Similar Artilces:

Redrawing a Window Based on Input
Hello, all: I've a small problem I'm trying to tackle. I have a dialog box application that creates an instance of my own class derived from CWnd. BOOL CMyDialog::OnInitDialog() { ... this->m_pMyWnd = new CMyWnd; this->m_pMyWnd->Create(NULL, NULL, WS_OVERLAPPEDWINDOW & ~WS_MINIMIZEBOX & ~WS_MAXIMIZEBOX | WS_CHILD | WS_VISIBLE, rect, this, 1000); ... } The dialog box creates the derived window, and the window can be moved and dragged about the dialog box. However, I also have stationary buttons in the dialog box that are supposed to change the canvas in...

One thing I REALLY HATE about Outlook and Office.....
I really hate the fact that I open an email, open the attachment (word or Publisher) , then spend 4 hours editing a document someone sent me. I press save, and close the document. I open Word or Publisher again to work on the file, and It is not in the recent documents list. Then I remember that it was an attachment in an email - Open that attachment again, but what I get is the un-edited version. The version that I worked on for 4 hours is GONE! This happens in Outlook, as well as Live mail. Really sucks to be me right now. Any way to get these documents back? /cl "ChinaLamb&...

Wordart redraw
In Publisher 2003 SP2 I create a WordArt. When I click on OK it does a continual or looping redraw in the document page. How do I stop the continual or looping redraw of the WordArt characters? Help, detect and repair. Your video driver may need upgrading. Do this, slide the acceleration down on your adapter a couple of notches, control panel, display folder, settings tab, advanced button, troubleshoot tab. If this solves your issue go to the manufacturer's web site of your graphic card and look around for an updated driver. -- Mary Sauer MSFT MVP http://office.microsoft.com/ htt...

Display redraw problem when entering items
I'm using Money 2003 and when I enter items downloaded from my bank, the screen doesn't always redraw correctly leaving my main window in a mess with repeated lines and missing lines. This can be refreshed by scrolling up or down to force the screen to be redrawn, but it's really infuriating and adds considerably to the time taken to go through this process. Is this a known bug? Is there a patch/fix for Money 2003? Has it been fixed in Money 2004? Have you got the latest drivers for your video card? -- Regards Bob Peel, Microsoft MVP - Money Hints/Tips http://suppor...

Redraw
Can money be used to keep track of a mortgage with a redraw facility? If so, how can I use it to see the balance of the mortgage and the amount available for redraw? ...

ListView_SubItemHitTest redraws items
I have created my own CListCtrl derived control. In this I need to override OnToolHitTest(). In this a call ListView_SubItemHitTest() to detect over which item the mouse pointer is. But when I do that the item is redrawn, which make my list flickering. This only happens when I have a manifest file and when the application is dialog based and the application run on WinXP. The following code illustrates the problem: CFlickerList is derived from CListCtrl: void CFlickerList::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNM...

how to redraw the bitmap in a dialog box
hello, Can someone tell how to do this since i have been struggling with it for more than 2 weeks. My application draws a series of bitmaps on the dialog box one after the other. Its something like an animation where i read the bitmaps from a file and draw each one subsequently in a specified region of the dialog box using "dc.bitblt" in a while loop in the OnPaint message handler.Everyhtin is working fine but the problem arises when i move this dialog box outside the client area of the application and then move it back in or minimise the application and maximise it again. Then the O...

redraw thing
So my Excel app has VBA code that does a long file read and update operation. This can take up to one hour. And the client wants it to show a "please wait" message while it is doing this to help assure that it isn't just hung. So I added a non-modal user form with the message. Put it up on the screen before the work starts, and unload it again after the work is done. My problem is, the form does not finish redrawing before the work starts. And by then, Excel is sucking all the CPU doing the work, so the form does not redraw. It shows an empty frame the entire time. Which just m...

Redrawing question
Hi all, I have listbox in my application...Now when i enter the data into it, i do it using InsertString starting from top....Now when the number of rows entered becomes equal to size of listbox.....data gets added but is not seen(i need to move the scroll bar to see that data)....what i want is at all the time i should be able to see the last string entered....if strings entered in the begining are not seen then its ok.....how should i do that in listbox..........also one other thing i would like to add is data gets entered every 2 econds(i.e, a new string is added every 2 seconds)......

CScrollview not redrawing properly
I have a CScrollView onto which I drew some text using the DrawText call. But it isn't working like it should. If I resize the window so that the last lines of text aren't showing, then scroll down, they don't show up. I scroll back up, and the top lines are there. Then, if I resize the window back to large, I can see the bottom lines again. This must have something to do with the drawing, but I'm not quite sure how exactly the drawing is handled when scrolling with the CScrollView object. Please help! In OnDraw() for the ScrollView, I have: CRect clientRect; GetClientR...

Things have got brighter and it's not cool
Hi, my Office docs, inc Outlook and even the pages on IE have suddenly appeared washed out and a lot brighter. It is making my eyes strain and the blue wording you often see on IE pages such as on forums, is faint now, at least the small words that are often to the side of boxes etc. I did a system restore and that came back as successful but there was no change to the bright pages, they are still bright and washed out. All of the boxes for instance in Outlook at the bottom left of the screen, are all bright and washed out, everything is. I've not been fiddling with...

Redrawing pushbutton
My animation graphics, e.g., dragging a sprite, are "erasing" my CButton. What should I call to update the pushbutton's window? Invalidate() or InvalidateRect() UpdateWindow() ? AliR "Steve Russell" <srussell@removethisinnernet.net> wrote in message news:%23ZeGtyGzFHA.1256@TK2MSFTNGP09.phx.gbl... > My animation graphics, e.g., dragging a sprite, are "erasing" my CButton. > What should I call to update the pushbutton's window? > Thank you. That does the job, though the button flickers due to multiple redraws as the sprite is pa...

I have probably done a very silly thing
I have now done a very silly thing. I have been playing around to get a better understanding how all this works. I have right click and take properies on the builtin\administrator and then select the server Roles and here I have unchecked the sysadmin. This mean that I can't check this sysadmin for builtin\administrator any more the errro message is user does not have permission to perform this action. Is there any workaround to fix this I might have to reinstall SQL Server Express 2005 that is included in Visual Studio 2005. How do I reinstall SQL Server Express 2005...

CToolBar
hi ng, does anybody know howto redraw the full client area of a CToolBar? not only the area where are the buttons visible! -- kind regards, muechel See if RecalcLayout does the trick. If not, try Invalidate/Updatewindow on the toolbar and if docked, on its parent(CDockBar). -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "M�chel" <Muechel@gmx.at> wrote in message news:eAASXSv9DHA.3880@TK2MSFTNGP11.phx.gbl... | hi ng, | | does anybody know howto redraw the full client area of a CToolBar? | | not only the area where are the buttons visible! | -- | kind regards, muechel ...

same thing here
Exactly the same thing is happening in our office, we are running Windows XP SP3 and Office 2007, Powerpoints 2007 keep crashing when editing charts, it's really frustrating. Anybody found any way to fix this problem? There's a hotfix. http://support.microsoft.com/kb/975021 -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/32a7nx "Peter Vidlicka" <peter.vidlicka@gmail.com> wrote i...

$5.00 is a good thing
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P>&nbsp;</P> </BODY> </HTML> ...

Redraw Frame
I've kind of left this one on the back burner. The app is at: http://lakeweb.net This application can easily push the cpu to 100%. If it doesn't have enough time to draw, it will just slow down the refresh, which is fine. Once the cpu gets up 80%, delays in repainting the frame become noticeable and can take over a second to hit. The frame rate is driven from a thread that sleeps 40 ms. at a time, then invalidates the view. I'm not sure how to see that the frame gets priority when needed. Best, Dan. --- ...

User's Guide--can we get this thing some other way?
I do not have broadband and using the user's guide the M05 is driving me crazy. Is there any other way to get the info so that old fogies like me who actually prefer to read a book can function? Apparently Most Users Prefer(tm) it this way... "Donna Ford" <cdford@integrity.com> wrote in message news:OKm4tJWNFHA.2252@TK2MSFTNGP15.phx.gbl... > I do not have broadband and using the user's guide the M05 is driving me > crazy. Is there any other way to get the info so that old fogies like me who > actually prefer to read a book can function? Gina Carrillo has...

Dynamic move & redraw problem
Hello all - I have a list control in a dialog box. When the user clicks a row, I want to put some combo boxes and edit controls above the fields so the user can edit. I create my edit controls off screen. When I get my WM_NOTIFY that a row has been selected in the list, I move the edit control over the list control. The problem is that the edit controls do not draw themseleves correcty. They are position there cos I can click around and the combo list will drop down and then I can see it. But the initial move isn't drawing updating properly. I am using SetWindowPos. I've tried ...

Redrawing a treeitem
In a CTreeView a treeitem (A) will be drawn in black. Then I draw several treeitems (B, C, D) that have (A) as their parent using different colors (red, blue, black) depending on 'something'. Now I would like to redraw (A) if a subtreeitem has been colored red, or blue if no subtreeitem has been colored red. I would like to REDRAW rather than to find out first if (A) has to be colored as it is MUCH easier to do this afterwards because B,C and D have to find out what color they should use at the moment of drawing. So I would like to know if it is possible to redraw a particular treeite...

Excel formulae start doing strange things
Has anyone had the problem where the result of a formula is incorrect. I've had on occasion entered a simple formula, such as adding a group of numbers within an "IF" statement and the result is wrong. If I start a new workbook, and enter the exact same thing, it works out correctly. Yesterday one of my co-workers had a problem with a spreadsheed she's been using for years. All of a sudden, she started getting "VALUE" errors in the lower half of the spreadsheet. All formulae were the same in each row. I ended up fixing the problem by deleting 5 rows, then entering ...

Redraw problem
I have a dialog based app which has a row of buttons at the bottom of the client area and a slider just above the buttons. When the dialog window is re-sized I set the position of the buttons and a slider so that they are always at the bottom of the dialog's client area. This works OK except that if I resize the dialog vertically by dragging its top or bottom up and down repeatedly *rapidly*, the buttons and slider end up with fragments of other controls drawn across them. For example the slider has bits of the button text across it. I can't get rid of these fragments unless I forc...

Make it more simple or intuitive to do simple things
I appreciate the fact that applications are becoming more versatile and able to do things that we hardly thought possible in the past but I feel that in this added complexity you are losing sight of the need to do simple things easily without resorting to trial and error or consulting "help" which often anyhow doesn't lead one straight to the solution! An example is how to produce a chart with a series of months i.e Jan Feb Mar etc appearing on the X axis. This is no doubt something that resulted naturally in the first versions of Excel charts or in a competitor's ea...

Mortgage Loan with Redraw Facility
What is the best way to set up a Mortgage with a Variable Interest Rate Calculated Daily (Charged Monthly) The Mortgage has a redraw facility. My min payment is $160 / Mth. If I pay $100 / Week I have an amount of $240 I can redraw & spend. But interest is calculated on what money I have saved in Total. ie $240 in Mortgage account plus $5000 savings account So if my Mortgage was $100,000. Interest would be calculated on $94,760 I think you would be best off setting this up either as a credit card or as a liability. The standard "loan" account type would be difficult to ma...

Redraw problem in ownerdraw listbox
Hi, I have a array of ownerdrawn listbox. when its gets displayed, it displayed perfectly. But, when I click on any of the listbox, the borders are disappeared. Also, when I minimize the application and maximize it again, it displays perfectly with the borders. FYI, I have derived a class from CListBox. Please help me to identify the problem. Karthic Generally, this is caused by drawing on the border area. When you are called in OnDrawItem, you are given in the DRAWITEMSTRUCT a rectangle, I think it is called rcItem. You must NOT draw outside that rectangle. In particular, if you do G...