Microsoft KB Archive/103707: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
Line 23: Line 23:
The following macro will return the height of the status bar and display it in an alert box.
The following macro will return the height of the status bar and display it in an alert box.


A1: Status_Height A2: =WORKSPACE(,,,,FALSE) A3: nostatusbar=GET.WORKSPACE(14) A4: =workspace(,,,,TRUE) A5: statusbar=GET.WORKSPACE(14) A6: statusbarheight=nostatusbar-statusbar A7: =ALERT("The height of the status bar in points is "&statusbarheight) A7: =RETURN()
A1: Status_Height A2: =WORKSPACE(,,,,FALSE) A3: nostatusbar=GET.WORKSPACE(14) A4: =workspace(,,,,TRUE) A5: statusbar=GET.WORKSPACE(14) A6: statusbarheight=nostatusbar-statusbar A7: =ALERT("The height of the status bar in points is "&statusbarheight) A7: =RETURN()


Microsoft provides macro examples for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Microsoft provides macro examples for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Line 29: Line 29:
== REFERENCES ==
== REFERENCES ==


"Function Reference," version 4.0, pages 209-212, 465-466
"Function Reference," version 4.0, pages 209-212, 465-466


{|
{|
Line 43: Line 43:
<br />
<br />
<br />
<br />
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
</blockquote>
</blockquote>
<span>Last reviewed: September 12, 1996</span><br />
<span>Last reviewed: September 12, 1996</span><br />
[[../cpyright|©1997 Microsoft Corporation. All rights reserved. Legal Notices]].<br />
[[../cpyright|©1997 Microsoft Corporation. All rights reserved. Legal Notices]].<br />
|}
|}

Revision as of 08:27, 20 July 2020

Microsoft Knowledge Base

Excel: Using GET.WORKSPACE() to Determine Screen Element Size

Last reviewed: September 12, 1996
Article ID: Q103707

The information in this article applies to:

  • Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a, 5.0
  • Microsoft Excel for the Macintosh, versions 3.0, 4.0

SUMMARY

When you develop a custom application in Microsoft Excel that will run on machines with different screen resolutions, it may be useful to determine the amount of space that different workspace elements such as the menu bar, formula bar, status bar and/or toolbar will use. After determining the amount of space these elements use, you can then determine how and where to position documents and which of these elements you want to be displayed.

Use the GET.WORKSPACE() macro command to determine the element size. This command takes a type_num argument which specifies the type of workspace information you want; specifying a type_num of 13 returns the usable workspace width and 14 returns the usable workspace height. You can determine the the size of an individual workspace element with GET.WORKSPACE(13) or GET.WORKSPACE(14) before and after you remove the element from the workspace. (Note: this is true for version 5.0 macro sheets, but not modules.)

Example

For example, if you want to determine the height of the status bar, use GET.WORKSPACE(14) before and after disabling the status bar with the WORKSPACE() macro command.

The following macro will return the height of the status bar and display it in an alert box.

A1: Status_Height A2: =WORKSPACE(,,,,FALSE) A3: nostatusbar=GET.WORKSPACE(14) A4: =workspace(,,,,TRUE) A5: statusbar=GET.WORKSPACE(14) A6: statusbarheight=nostatusbar-statusbar A7: =ALERT("The height of the status bar in points is "&statusbarheight) A7: =RETURN()

Microsoft provides macro examples for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

REFERENCES

"Function Reference," version 4.0, pages 209-212, 465-466


KBCategory: kbusage

KBSubcategory:

Additional reference words: 4.00a 4.00 3.00



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
©1997 Microsoft Corporation. All rights reserved. Legal Notices.