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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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,223,705
Messages
6,173,996
Members
452,542
Latest member
Bricklin

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