Print Preview + Coordinate Problem

L

lcvianna

Hi there,

I'm having a trouble with Excel 2003, and I've looked for an answer
all day without success, so I thought someone could help me.

We have a workbook containing lots of info the user needs to fill. To
help the user, some of those sheets have a QuickHelp routine - an "?"
icon that is displayed near the field, and when the user clicks the
icon it shows a Help document with the info about that field.

To do this, I created a sub who would do the job, and in the selection
change event I called this function, like the following:

Private Sub Worksheet_SelectionChange(ByVal target As Range)
ShowQuickHelp
End Sub


Sub ShowQuickHelp()

Dim sheetActive As Worksheet
Set sheetActive = ActiveSheet

' Hides the old shape, showing only the new one.
If Not shapeQuickHelp Is Nothing Then
shapeQuickHelp.Visible = msoFalse
End If

If MustShowQuickHelp = True Then
Set shapeQuickHelp =
sheetActive.Shapes(Range(RANGE_QuickHelpShape).Value)

shapeQuickHelp.Visible = True
shapeQuickHelp.Top = ActiveCell.Top + 1.3
shapeQuickHelp.Left = ActiveCell.Left + 1.5

' The command below asign the specific macro to each shape.
shapeQuickHelp.OnAction = Range(RANGE_QuickHelpMacro).Value
End If

Set sheetActive = Nothing

End Sub

This routine works perfectly, until the user calls the "Print Preview"
comand. When this occurs, some of the sheets (about half of them) go
crazy, and start to mix coordinates - Instead of displaying the icon
in the correct cell, according with the cell top and left coordinates,
the icon is displayed in another place.

I debbuged the routine, and notice that the ActiveCell continues to
represent the correct cell, the coordinates continue the same, but
somehow the Excel starts to understand Top and Left in a different way
from before. For example, Top = 100 represents a diferent position
before/after the print preview.

The most unpleasant effect is that this just occur with half of the
sheets. The other half works perfectly.

Could someone help me please?
 
L

lcvianna

Another points I forgot to mention:

This occur when the user selects several sheets and uses the "Print
Preview" command. I also noticed that if I select each sheet alone and
click in "Print Preview", the problem stops.
 

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