Trying to get the placement of Excel window on screen on Mac

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
308
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I ran across some code on another site that is supposed to get the placement of the Excel application window on the screen of a Mac. The code can be found here:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=452#instr

It works on Excel 2011, but not on Excel 2019. The string variable scrRet is supposed to return either the placement of the window, or "error". When I run it on Excel 2019 for Mac, it just returns an empty string.

I did a Debug.Print of the string variable scr1, which holds the Apple Script text that will be performed to get the placement of the window. I took the output from the Immediate window and put that into the Script Editor and ran it, and it DID return the window placement. So the text of that string does work... it just isn't being returned from within VBA. I can't figure out why. Anyone have any ideas?

Or, does anyone know of a way to return the placement of the Excel application window another way?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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