ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Help on this complicated issue - VBA and the API to Dynamically Set Screen and Window Sizes (https://www.excelbanter.com/excel-programming/377078-need-help-complicated-issue-vba-api-dynamically-set-screen-window-sizes.html)

[email protected]

Need Help on this complicated issue - VBA and the API to Dynamically Set Screen and Window Sizes
 
I have an add-in that several users at work use. We all have dual
screens and like to run one version of excel open but have one workbook
open on each window. I created a sub routine that allows the user to
switch between just a single screen view and a dual screen view with
the ability to toggle the workbooks between the two screens. For
example Book 1, Book 2 and Book 3 are open and the use wants to have
Book 1 on the right screen but Book 2 and Book3 on the left screen. My
toggle allows them to set the Book on either screen. The problem I
have had is that everyone uses different tool bars in excel so when I
created the program I used my screen setup and settings to determine
sizes etc... but it doesn't look right on the other users screens.
Example my windows.width and .height are 675 and 957 respectively but
due to toolbars other users might need 670 and 940.

So
1) Can I somehow setup my add-in so that there is a drop down menu
that has a setup function which determins the screen characteristics
needed to successfuly set each window size for the toggle?
2) Can this setup also have some type of selection to determine
whether the user prefers the left screen or the right screen as their
main screen?
3) Some users have their screen numbers backwards so can the add-in
somehow determine if the left screen is display 1 or if it is display
2?

Any help on this is greatly appreciated as I have been messing with
this for quite sometime with no luck at all.

Thanks,
Will


NickHK

Need Help on this complicated issue - VBA and the API to Dynamically Set Screen and Window Sizes
 
Will,
I have something similar, unfortunately not dual screen but I can hope...

Use the values of
ActiveWindow.Height, etc
Application.UsableWidth, etc

to get the available coordinates/dimensions.

After a check that you actually have multiple monitors :
http://vbnet.mvps.org/code/core/getmonitorcount.htm

these routines should give you info :
http://vbnet.mvps.org/_vti_bin/shtml...ain/index.html

NickHK

wrote in message
ps.com...
I have an add-in that several users at work use. We all have dual
screens and like to run one version of excel open but have one workbook
open on each window. I created a sub routine that allows the user to
switch between just a single screen view and a dual screen view with
the ability to toggle the workbooks between the two screens. For
example Book 1, Book 2 and Book 3 are open and the use wants to have
Book 1 on the right screen but Book 2 and Book3 on the left screen. My
toggle allows them to set the Book on either screen. The problem I
have had is that everyone uses different tool bars in excel so when I
created the program I used my screen setup and settings to determine
sizes etc... but it doesn't look right on the other users screens.
Example my windows.width and .height are 675 and 957 respectively but
due to toolbars other users might need 670 and 940.

So
1) Can I somehow setup my add-in so that there is a drop down menu
that has a setup function which determins the screen characteristics
needed to successfuly set each window size for the toggle?
2) Can this setup also have some type of selection to determine
whether the user prefers the left screen or the right screen as their
main screen?
3) Some users have their screen numbers backwards so can the add-in
somehow determine if the left screen is display 1 or if it is display
2?

Any help on this is greatly appreciated as I have been messing with
this for quite sometime with no luck at all.

Thanks,
Will




[email protected]

Need Help on this complicated issue - VBA and the API to Dynamically Set Screen and Window Sizes
 
Thanks for the links - they are very helpful. I should be able to
figure this out now.


NickHK wrote:
Will,
I have something similar, unfortunately not dual screen but I can hope...

Use the values of
ActiveWindow.Height, etc
Application.UsableWidth, etc

to get the available coordinates/dimensions.

After a check that you actually have multiple monitors :
http://vbnet.mvps.org/code/core/getmonitorcount.htm

these routines should give you info :
http://vbnet.mvps.org/_vti_bin/shtml...ain/index.html

NickHK

wrote in message
ps.com...
I have an add-in that several users at work use. We all have dual
screens and like to run one version of excel open but have one workbook
open on each window. I created a sub routine that allows the user to
switch between just a single screen view and a dual screen view with
the ability to toggle the workbooks between the two screens. For
example Book 1, Book 2 and Book 3 are open and the use wants to have
Book 1 on the right screen but Book 2 and Book3 on the left screen. My
toggle allows them to set the Book on either screen. The problem I
have had is that everyone uses different tool bars in excel so when I
created the program I used my screen setup and settings to determine
sizes etc... but it doesn't look right on the other users screens.
Example my windows.width and .height are 675 and 957 respectively but
due to toolbars other users might need 670 and 940.

So
1) Can I somehow setup my add-in so that there is a drop down menu
that has a setup function which determins the screen characteristics
needed to successfuly set each window size for the toggle?
2) Can this setup also have some type of selection to determine
whether the user prefers the left screen or the right screen as their
main screen?
3) Some users have their screen numbers backwards so can the add-in
somehow determine if the left screen is display 1 or if it is display
2?

Any help on this is greatly appreciated as I have been messing with
this for quite sometime with no luck at all.

Thanks,
Will




All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com