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

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
275
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2011
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

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

Forum statistics

Threads
1,213,557
Messages
6,114,291
Members
448,564
Latest member
ED38

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