Why would a command button move after print preview?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On a HP laptop Excel 2002 the command buttons move to the right each time a
print preview is done. This does not happen on a desktop running the same
software or on another laptop & desktop with Excel 2003. I assume it is a
setting of some sort on the Laptop but have no idea what to look at any
sugestions?
 
The reason:-

http://support.microsoft.com/default.aspx?scid=kb;EN-US;838910
Controls move to the left of the worksheet in Microsoft Excel 2002

But Jim Rech recently posted this:

This article is now obsolete. Since the 10/12/2004 security patch
there is no need to get a hotfix (although this article does not directly
mention this fix, it's in there).

http://support.microsoft.com/default.aspx?scid=kb;en-us;832332

But Myrna Larson posted that it didn't work for her in all her workbooks.



To apply the workaround to a number of controls, Dave Peterson recently
posted this:-

Maybe you could use a macro to fix the controls on the sheet.

If you want to change every OLEObject, you could do this:

Option Explicit
Sub testme01()

Dim OLEObj As OLEObject
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
For Each OLEObj In wks.OLEObjects
OLEObj.Placement = xlMoveAndSize
Next OLEObj
Next wks

End Sub

If you want to be more conservative and only fiddle with the checkboxes:

Sub testme02()

Dim OLEObj As OLEObject
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
For Each OLEObj In wks.OLEObjects
If TypeOf OLEObj.Object Is MSForms.CheckBox Then
OLEObj.Placement = xlMoveAndSize
End If
Next OLEObj
Next wks

End Sub

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------­------------------------------­----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------­------------------------------­----------------
 
Back
Top