Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Preview + Coordinate Problem
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).Val ue) 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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Preview + Coordinate Problem
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. On 16 abr, 17:18, wrote: 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).Val ue) 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 "PrintPreview" 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 theprintpreview. The most unpleasant effect is that this just occur with half of the sheets. The other half works perfectly. Could someone help me please? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Page Preview/Print Problem | New Users to Excel | |||
Print Preview Problem in Excel | Excel Discussion (Misc queries) | |||
print/preview problem before saving an edited excel worksheet | Excel Discussion (Misc queries) | |||
Problem w/Print Preview since upgrade to office 2003 | Excel Discussion (Misc queries) | |||
VBA Problem - Print Preview | Excel Programming |