ActiveWindow.PointsToScreenPixelsY

L

Legacy 456155

Guest
Any idea why the following would return a negative number?

Debug.Print ActiveWindow.PointsToScreenPixelsX(0)

This line of code was returning what I expected and then all of the sudden began returning a negative number. A negative number on a two monitor desktop and my laptop as well. I searched and could find next to nothing.

ActiveWindow.PointsToScreenPixelsY seems to be working.

Thanks!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I am guessing .. monitor 1 is on the right and has the taskbar on it whereas monitor 2 is on the left. Zero horizontally is at the left side of monitor 1 so points to the left of it would be negative.
 
Upvote 0
Thanks Rick. It's also returning a negative number on my laptop with no external monitors connected.
 
Upvote 0
Well, I copied the project to a new workbook and it now works as intended. Problem solved? Not really. :)
 
Upvote 0

Forum statistics

Threads
1,224,746
Messages
6,180,705
Members
452,994
Latest member
Janick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top