View Single Post
 
Old 01-28-2012, 09:19 PM
Marrick13 Marrick13 is offline Windows XP Office 2010 32bit
Competent Performer
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Loop through listboxes in Application.OrganizerCopy

Paul,

Thanks so much. I applied your new code while keeping the stuff I added since the previous version and I think I have a good working copy now with all the functionality. The list sorts and everything seems to run well. You didn't need to do the clean up but since you did, thank you again - I really appreciate all your most generous help!

Since the previous version, I added code I found that allows one to resize the form by dragging an icon, something I didn't think was possible for a userform. I incorporated it with other resize functionality I had started, and now you can drag to resize, minimize and maximize almost like a real window. I have another application I'm working on (that formats cross references) for which a true resize would be very helpful, because one would want to toggle between the userform and document often. I have a primitive min-max feature for that application, and I will look into including this new code there to provide more resizing options.

As far as I can tell, aside from some other formatting issues I will deal with, there's one the one snag left with the Style Copier. I have two textboxes that are hidden until the copying starts. One, "txtProcessing", is supposed to show "Processing your request, please wait..." as soon as the copy button is clicked. When the routine finishes, that textbox is supposed to become hidden and another one right below it, "txtCopyStats", is supposed to become visible with an accounting of the number of styles copied to the number of files.

I cannot get the "txtProcessing" to display at all until the copying is finished, at which point it serves no purpose. As I wrote previously:

I have another problem with a msgbox I just added to the Sub CmdCopyStyle_Click module. The intention is to display a textbox reading "Processing..." as soon as the copy routine starts ("Me.txtProcessing.Visible = True"). When I step thru the code, the textbox displays and shuts off at the end when another textbox displays showing the number of styles copied to the number of documents. But during runtime the "Me.txtProcessing.Visible = True" has no effect; if I comment out the statement that shuts it off when the other stats textbox becomes visible, then the txtProcessing textbox displays (so both appear at the same time, but only after the copy code has run).

I even placed a beep just before the "Me.txtProcessing.Visible = True" and it did beep during runtime but still didn't display the textbox. If I place an exit sub right after the statement, the textbox displays (but of course the code stops). So then I tried some code to delay the macro and even put the whole module in another module and ran the display code separately to see if I could "fool" VBA, but nothing worked. I also tried adding if statements, and that didn't do anything.

So there's apparently something about the loop code that prevents the textbox from displaying (but only during runtime). Seems like this is a such a simple thing, but I can't figure out why it doesn't work. Any idea why the txtProcessing doesn't display when it should during runtime?

Latest version (Jan 28) is attached.
Attached Files
File Type: doc Style Copier Application (Jan 28 2012).doc (132.5 KB, 30 views)
Reply With Quote