Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy question

Status
Not open for further replies.

PTinVT

Programmer
Oct 9, 2002
8
US
Hi, I'm retrieving data from a recordset in VB6 and writing it to an Excel spreadsheet. It is quite a long process and a simple hourglass might not be enough to make impatient user's wait until it's finished. Is there a way to lock the spreadsheet while the data is loading so the user's won't click on it before it's done loading? Thanks!
 
One thing you could do is not make the spreadsheet visible until it's done. You'd need to give an explicit .Visible = True for it, so nothing stopping you from holding off until it's done.

That might cause more trouble than it's worth, though - impatient users clicking that "Export to Excel" button over and over, for instance...personally I've educated my users to let the spreadsheet finish before they interact with it.



"Much that I bound, I could not free. Much that I freed returned to me."
(Lee Wilson Dodd)
 
Hi,
I suggest that you don't show the excelform until it is ready. You could show a form with a progressbar so that your users know how long they have to wait. E.g.

progressbar1.min = 0
progressbar1.max = rsdata.recordcount
progressbar1.value = 0

l=0
do while not rsData.bof and not rsdata.eof
l = l + 1
progressbar1.value = l
'write the data to the sheet
rsdata.movenext
loop

Finally you show the excel form via objectname.visible = true

Good luck,
Frank
 
PTinVT, please give meaningful titles to the threads you start, something related to the subject.

See thread222-2244
Thankyou.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top