Error Setting Excel's Application.Left Property

J

James Cox

Win XP Pro, Excel 2002 SP3

We're seeing a growing problem with some folks using multiple monitors and
saving Excel workbooks that are in strange locations. In some cases,
single-monitor users are opening the workbooks and seeing nothing except the
grey background.

To avoid this, I wrote a bit of code to repostion the worksheets where they
could be seen - it works fine for me, but some other users are getting an
error message:

Runtime Error 1004
Method left of Object _Application Failed

Logged in as one of the other users and working in the Immediate Pane, I've
verified that they indeed cannot set the left or top property of Application
without getting this error. Any insights what's going on? Code follows:

Private Sub Workbook_Open()
'If the workbook was on the left screen when it was saved, move the left
edge of the Excel window to the left edge of the right
' (or only screen)
If Application.left < 0 Then Application.left = 0

'If the worksheet is farther to the left than the width of the Excel
window, move the worksheet to the left edge of the
' Excel Window
If Application.Width < ActiveWindow.left Then ActiveWindow.left = 0

End Sub


Thanks for any help!

James Cox
 

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