I only really know Windows system library call techniques and assumed that OSX would have a similar capability.
![]() I have found references to something in Cocoa relating to NSWindows (whatever they are) that allows a value of NSFloatingWindowLevel to be set such that it will float above all other windows. There is even a reference to another value that apparently would make a window float above even the screensaver, but thats not necessary. ![]() In Windows its straight forward: You use the user32 FindWindow function to get the handle of the userform widow by its window title, then use that handle to set the window level to TopMost. Excel 2011 Userform Resize Mac All IIs there a similar method that can be used in VBA to achieve the same result from Excel VBA on a Mac All I need is for the userform to appear over the top of the current application window when activated, always on top, topmost, or floating in some way - it doesnt matter as long as the popup is immediately visible to the user. By way of background as to why Id like to achieve this; my application is a time keeping tool and it is designed to prompt the user to periodically record what theyve been doing in the previous period (e.g. Of course, while the userform may activate in Excel, if it is not visible and behind another application window, then it kind of defeats the purpose as the user is not reminded to record their time, especially if they have change tasks. Anecdotally, I think this used to work in earlier versions of O365, Excel for Mac as I only seem to have experienced this challenge in the past few months and I transferred my workbook and its macros to Mac almost 1yr ago. Perhaps the userform.show modeless function has changed I wouldnt be surprised as an earlier build of Excel (15.12 I think) stopped all the forms buttons from working and the most recent build 15.22 stopped the userform textbox control (at least) from being able to be edited properly and i had to reinstalled Excel 15.21. I am still waiting for a new build to be released that corrects the problems introduced by 15.22, but have a 15.21 pkg file on standby. Excel 2011 Userform Resize Mac OSX Somewhere ThatIm still thinking there must be a library in Mac OSX somewhere that includes a suite of window manipulation functions that should be able to be called from VBA or any other programming language. My basic premise is that, like Windows, there is a set of API calls available in OSX that allow manipulatiuon of application windows. After all its a basic function of the OS in that windows need to be created and manipulated (moved around etc). It would seem only logical that the OS would expose the APIs to all windows to be manipulated programatically. Therefore Id need to know the dylib and contained function(s) and parameter values to define and call from VBA. The reference to NSWindows and NSFloatingWindowLevel, seem to refer to some sort of Cocoa programatic interface to set a window atop the desktop by floating it above everything. However the only references to this I can find seem to use some weird coding format, perhaps assuming all the dylib inclusions have already been done. Anyway, still hunting for an answer - Its got to be out there, but Im surprised its not as easy to find as the Windows equivalent was. I kind of get it, since its a recent inclusion in OSX, but I dont get why it might prevent an Excel (or any other VBA application for that matter) VBA userform might not appear top-most when shown as modeless. I would also prefer not to disable SIP:S But back to the actual question Im not so much looking for a reason why it may have stopped, rather a way to programatically make the userform window become topmost or float on the desktop. This is easily achieved in Windows and Ive found some references to something called NSWindows Setlevel commandapi and a parameter NSFloatingWindowLevel that seems to be what Im looking for. However, i havent been able to figure out just how (assuming its possible) I could call the function from VBA.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |