Centering Calculator

D

Denny Behnfeldt

I am using the following code (borrowed from...?) to display the Calculator.
However, it appears at different places onscreen each time. Is it possible
to center it when displayed?

Sub StartCalculator()
AppFile = "Calc.exe"
On Error Resume Next
AppActivate ("Calculator")
If Err <> 0 Then
Err = 0
CalcTaskID = Shell(AppFile, 1)
If Err <> 0 Then msgbox ("Can't start Calculator")
End If
End Sub

Thanks for any help,
Denny
 
F

Frank Kabel

Hi Denny
AFAIK you can't. Unless the calculator does not save his own last
position no chance
 
L

L. Howard Kittle

Hi Denny,

I assigned the code to a forms button, click to make the calculator appear.
Then I centered it in the window and:

If you use the X on the calculator to get rid of it, the next time you hit
the button the calculator comes up in a different place.

If you click the button to get rid of the calculator it will come back to
the spot you assigned in the first place.

So, in my little test, just click the button to toggle the calculator on and
off the sheet.

HTH
Regards,
Howard
 
D

Debra Dalgleish

Instead of code, you can add an existing toolbar button to make the
calculator appear:

Choose Tools>Customize
Select the Commands tab
Select the Tools category
Scroll down the list of commands, to find the Calculator
(the calculator icon, with the name 'Custom'
Drag the Calculator icon to an existing toolbar
Click OK
Click the Calculator button to open the calculator
 

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