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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,215,566
Messages
6,125,593
Members
449,237
Latest member
Chase S

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