The attached contains API code that gets the position of mouse click (when clicking Active X button on sheet1).
When that button is clicked, Userform1 appears over the button, when xlApp is located on the main laptop (not extension) screen.
code sourse: http://ramblings.mcpher.com/Home/excelquirks/snippets/mouseposition
My laptop has an extension screen that is wider and deeper than the laptop screen
When xlApp is launched on the laptop screen ans then dragged onto the extension screen, the horizontal positioning of the userForm (via mPos.left in Public Function convertMouseToForm) ceases to track mouse click, over the right hand half of the extension screen. In contrast, mPos.Top is detected accurately on either screen.
When I make the extension screen the Main screen (via Screen resolution), then mPos.left accurately tracks mouse click over both screens.
How do I detect the main screen and correct the calculation of mPos.left when the small laptop screen is assigned as main screen?
APIs are not a strength of mine.