Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Cursor change during code execution

Hi
I am unable to effectively change the cursor during a wbook add and save
operation from a cmdbutton on a form. From the code below there is sometimes
a brief change but not at the statement. The code forms part of an xla and
the new wbook can have anything from 50 to 40,000 plus rows - so some form of
indicator (apart fr4om the status bar) during the at times long copy
procedure would be very welcome.
Application.Screenupdating = True / False does not seem to have any effect.
Is there anything I am missing? Appreciate any advice.

T.I.A.

Geoff

Private Sub cmdExecute_Click()
'''.... other stuff

Application.Cursor = xlWait

'''add new wbook
Set procFile = Workbooks.Add()
'''save new wbook
procFile.SaveAs Filename:= _
fName, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
'''copy required data
sh.UsedRange.Copy Destination:=procFile.Worksheets(1).Range("A1")
'''save new wbook with data
ActiveWorkbook.Save

Application.Cursor = xlDefault

'''.... other closing stuff
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Cursor change during code execution

Try some DoEvents statements before and after your cursor changes.

RBS

"Geoff" wrote in message
...
Hi
I am unable to effectively change the cursor during a wbook add and save
operation from a cmdbutton on a form. From the code below there is
sometimes
a brief change but not at the statement. The code forms part of an xla
and
the new wbook can have anything from 50 to 40,000 plus rows - so some form
of
indicator (apart fr4om the status bar) during the at times long copy
procedure would be very welcome.
Application.Screenupdating = True / False does not seem to have any
effect.
Is there anything I am missing? Appreciate any advice.

T.I.A.

Geoff

Private Sub cmdExecute_Click()
'''.... other stuff

Application.Cursor = xlWait

'''add new wbook
Set procFile = Workbooks.Add()
'''save new wbook
procFile.SaveAs Filename:= _
fName, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
'''copy required data
sh.UsedRange.Copy Destination:=procFile.Worksheets(1).Range("A1")
'''save new wbook with data
ActiveWorkbook.Save

Application.Cursor = xlDefault

'''.... other closing stuff
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Cursor change during code execution

Hi
I'd tried DoEvents with no success however, continuing the research, I have
found that using mousepointer does the trick as in:

frmBookMaker.MousePointer = fmMousePointerHourGlass
then
frmBookMaker.MousePointer = fmMousePointerDefault

As long as the mouse is not moved from the form this works fine.

Geoff

"RB Smissaert" wrote:

Try some DoEvents statements before and after your cursor changes.

RBS

"Geoff" wrote in message
...
Hi
I am unable to effectively change the cursor during a wbook add and save
operation from a cmdbutton on a form. From the code below there is
sometimes
a brief change but not at the statement. The code forms part of an xla
and
the new wbook can have anything from 50 to 40,000 plus rows - so some form
of
indicator (apart fr4om the status bar) during the at times long copy
procedure would be very welcome.
Application.Screenupdating = True / False does not seem to have any
effect.
Is there anything I am missing? Appreciate any advice.

T.I.A.

Geoff

Private Sub cmdExecute_Click()
'''.... other stuff

Application.Cursor = xlWait

'''add new wbook
Set procFile = Workbooks.Add()
'''save new wbook
procFile.SaveAs Filename:= _
fName, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
'''copy required data
sh.UsedRange.Copy Destination:=procFile.Worksheets(1).Range("A1")
'''save new wbook with data
ActiveWorkbook.Save

Application.Cursor = xlDefault

'''.... other closing stuff
End Sub





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
Starting a macro execution where the cursor happens to be [email protected] Charts and Charting in Excel 1 November 4th 07 07:16 AM
Pause Code Execution Luke Bailey Excel Programming 2 June 15th 06 08:33 PM
turning on/off cursor movement during VBA execution ktisqj Excel Programming 1 August 27th 05 12:20 AM
Can I change the "white cross" cursor in Excel to another cursor? KFEagle Excel Discussion (Misc queries) 1 May 3rd 05 08:01 PM
code execution has been interrupted François Excel Discussion (Misc queries) 1 February 18th 05 11:06 PM


All times are GMT +1. The time now is 01:09 AM.

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"