Mouse pointer as an hourglass.

N

Newbie

Hello,

My VBA macro in Project Pro is creating a report in MS Word. While the macro
is running, I would like to have the mouse pointer as an hourglass.
How can I do ?

Thanks for help.

Newbie.
 
J

John

Newbie said:
Hello,

My VBA macro in Project Pro is creating a report in MS Word. While the macro
is running, I would like to have the mouse pointer as an hourglass.
How can I do ?

Thanks for help.

Newbie.

Newbie,
I use two different methods to let the user know the code is executing.
One method is to use either the window or application Caption Property
or StatusBar Property to give a running dialog of macro status. For more
information about using the former, check the VBA help file. A typical
line of code might look something like:
Application.ActiveWindow.Caption = "Transferring data - " & _
Format(i / tskcount, "##%")
where "i" is an index for the current task object

The other is to use an hourglass as you suggest. For the latter (i.e.
hourglass), you will need to create a simple userform since that is
where the hourglass constant resides. For more information on that,
check the VBA help file on creating and using userforms. Once the
userform is set up I use the following code syntax:
frmCobra.MousePointer = fmMousePointerHourGlass
where Cobra is the name of my userform

Although I don't remember specifically, I believe these items are
addressed in the VBA tutorial which can be found on our MVP website at:
http://project.mvps.org/links.htm
Look for the link at the bottom of the page for, "Project 98 Visual
Basic Environment Training Materials". Even though it says it is for
Project 98 it is equally applicable to all current versions of Project.

John
Project MVP
 
N

Newbie

Thanks a lot John !

John said:
Newbie,
I use two different methods to let the user know the code is executing.
One method is to use either the window or application Caption Property
or StatusBar Property to give a running dialog of macro status. For more
information about using the former, check the VBA help file. A typical
line of code might look something like:
Application.ActiveWindow.Caption = "Transferring data - " & _
Format(i / tskcount, "##%")
where "i" is an index for the current task object

The other is to use an hourglass as you suggest. For the latter (i.e.
hourglass), you will need to create a simple userform since that is
where the hourglass constant resides. For more information on that,
check the VBA help file on creating and using userforms. Once the
userform is set up I use the following code syntax:
frmCobra.MousePointer = fmMousePointerHourGlass
where Cobra is the name of my userform

Although I don't remember specifically, I believe these items are
addressed in the VBA tutorial which can be found on our MVP website at:
http://project.mvps.org/links.htm
Look for the link at the bottom of the page for, "Project 98 Visual
Basic Environment Training Materials". Even though it says it is for
Project 98 it is equally applicable to all current versions of Project.

John
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top