Darrell
Registered User.
- Local time
- Today, 06:05
- Joined
- Feb 1, 2001
- Messages
- 329
OK this one is baffling me.
I have a Gantt chart workbook that adds a textbox to a worksheet and its top/left position is offset from where the first coloured square of the project is created. (-9 columns and -2 rows)
This works fine and has done for many years, however, I've just found that if I run the procedure with the workbook active on my secondary monitor (which I never do, except today to find out why my colleague had problems) the textbox is placed in a completely different position and not even aligned on a cell.
I did a bit of reading about DPI values etc and checked that each monitor had the same value, which they do.
There is also a bit in the code which ensures that the sheet is set to 100% zoom before it runs.
I also checked that if my colleague ran it on her primary monitor that it would work properly, and sure enough it did.
So I'm stuck
I have a Gantt chart workbook that adds a textbox to a worksheet and its top/left position is offset from where the first coloured square of the project is created. (-9 columns and -2 rows)
Code:
Set TB_Range = MySheet.Range(Cells(StartRow - TBOffset, StCol - 9), Cells(StartRow - TBOffset + 2, StCol - 2))
Set tb = MySheet.Shapes.AddTextbox(msoTextOrientationHorizontal, TB_Range.Left, TB_Range.Top, TB_Range.Width, TB_Range.Height)
This works fine and has done for many years, however, I've just found that if I run the procedure with the workbook active on my secondary monitor (which I never do, except today to find out why my colleague had problems) the textbox is placed in a completely different position and not even aligned on a cell.
I did a bit of reading about DPI values etc and checked that each monitor had the same value, which they do.
There is also a bit in the code which ensures that the sheet is set to 100% zoom before it runs.
I also checked that if my colleague ran it on her primary monitor that it would work properly, and sure enough it did.
So I'm stuck
