Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default URGENT !! Drawing Programme in excel

I have written a drawing programme in excel to produce floor plans &
elevations for sheds. I now want to distribute the programme but need to have
all of the scaling to change to the current users screen size. I am after
ways of VB knowing what screen size the user has & how I can set my page tops
etc. to suit this so the shapes are positioned correctly on the page. At the
moment I have hard coded in where my shapes are to start positioning but this
is no good when a new user has a different monitor size as it throws it all
over the screen.

Also am looking for ways of locking users out of code and creating
distributor versions so that we have the ability to monitor how they are
using there programme & what they are using it for.

Urgent help required.

thanks
--
SS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default URGENT !! Drawing Programme in excel

This will give you the screen resolution:

Option Explicit
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Const SM_CYCAPTION = 4
Private Const SM_CXBORDER = 5
Private Const SM_CYBORDER = 6
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const SM_CXVIRTUALSCREEN As Long = 78
Private Const SM_CMONITORS As Long = 80
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long

Sub getScreenResolution(lWidth As Long, lHeight As Long)
lWidth = GetSystemMetrics(SM_CXSCREEN)
lHeight = GetSystemMetrics(SM_CYSCREEN)
End Sub

Sub test()
Dim lWidth As Long
Dim lHeight As Long
getScreenResolution lWidth, lHeight
MsgBox lWidth & " x " & lHeight, , "screen resolution"
End Sub


RBS


"StevenS" wrote in message
...
I have written a drawing programme in excel to produce floor plans &
elevations for sheds. I now want to distribute the programme but need to
have
all of the scaling to change to the current users screen size. I am after
ways of VB knowing what screen size the user has & how I can set my page
tops
etc. to suit this so the shapes are positioned correctly on the page. At
the
moment I have hard coded in where my shapes are to start positioning but
this
is no good when a new user has a different monitor size as it throws it
all
over the screen.

Also am looking for ways of locking users out of code and creating
distributor versions so that we have the ability to monitor how they are
using there programme & what they are using it for.

Urgent help required.

thanks
--
SS


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default URGENT !! Drawing Programme in excel

Thanks so much. Have got this working will see how I go on other computers.
--
SS


"RB Smissaert" wrote:

This will give you the screen resolution:

Option Explicit
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Const SM_CYCAPTION = 4
Private Const SM_CXBORDER = 5
Private Const SM_CYBORDER = 6
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const SM_CXVIRTUALSCREEN As Long = 78
Private Const SM_CMONITORS As Long = 80
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long

Sub getScreenResolution(lWidth As Long, lHeight As Long)
lWidth = GetSystemMetrics(SM_CXSCREEN)
lHeight = GetSystemMetrics(SM_CYSCREEN)
End Sub

Sub test()
Dim lWidth As Long
Dim lHeight As Long
getScreenResolution lWidth, lHeight
MsgBox lWidth & " x " & lHeight, , "screen resolution"
End Sub


RBS


"StevenS" wrote in message
...
I have written a drawing programme in excel to produce floor plans &
elevations for sheds. I now want to distribute the programme but need to
have
all of the scaling to change to the current users screen size. I am after
ways of VB knowing what screen size the user has & how I can set my page
tops
etc. to suit this so the shapes are positioned correctly on the page. At
the
moment I have hard coded in where my shapes are to start positioning but
this
is no good when a new user has a different monitor size as it throws it
all
over the screen.

Also am looking for ways of locking users out of code and creating
distributor versions so that we have the ability to monitor how they are
using there programme & what they are using it for.

Urgent help required.

thanks
--
SS



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default URGENT !! Drawing Programme in excel

Thanks. Can you explain what the code is saying as i am only a fairly novice
programmer.
--
SS


"RB Smissaert" wrote:

This will give you the screen resolution:

Option Explicit
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Const SM_CYCAPTION = 4
Private Const SM_CXBORDER = 5
Private Const SM_CYBORDER = 6
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const SM_CXVIRTUALSCREEN As Long = 78
Private Const SM_CMONITORS As Long = 80
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long

Sub getScreenResolution(lWidth As Long, lHeight As Long)
lWidth = GetSystemMetrics(SM_CXSCREEN)
lHeight = GetSystemMetrics(SM_CYSCREEN)
End Sub

Sub test()
Dim lWidth As Long
Dim lHeight As Long
getScreenResolution lWidth, lHeight
MsgBox lWidth & " x " & lHeight, , "screen resolution"
End Sub


RBS


"StevenS" wrote in message
...
I have written a drawing programme in excel to produce floor plans &
elevations for sheds. I now want to distribute the programme but need to
have
all of the scaling to change to the current users screen size. I am after
ways of VB knowing what screen size the user has & how I can set my page
tops
etc. to suit this so the shapes are positioned correctly on the page. At
the
moment I have hard coded in where my shapes are to start positioning but
this
is no good when a new user has a different monitor size as it throws it
all
over the screen.

Also am looking for ways of locking users out of code and creating
distributor versions so that we have the ability to monitor how they are
using there programme & what they are using it for.

Urgent help required.

thanks
--
SS



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default URGENT !! Drawing Programme in excel

The main thing is the function GetSystemMetrics.
This is a Windows API function and these functions can be used in Excel by
declaring it like this.
Once it has been declared properly you can call it from your Excel code and
use the results.
These Windows API functions are very useful as they allow you to do things
that can't be done in regular Excel VBA code.
I would get some free API that lists all these functions and tells you how
to declare and use them, for example:
http://www.mentalis.org/agnet/apiguide.shtml

nIndex is just an argument for the GetSystemMetrics function and all the
possible (maybe there are more) are given in the constants that
are declared privately. I am only using SM_CXSCREEN and SM_CYSCREEN, but you
could use other ones to get other parameters of the screen.
lWidth and lHeight are arguments for the Sub getScreenResolution and these
arguments (variables) will be changed by this Sub and then will be available
to the Sub that calls getScreenResolution, in this case the Sub test.

That really is it. Once you start using these API's you will see how useful
they are.

RBS



"StevenS" wrote in message
...
Thanks. Can you explain what the code is saying as i am only a fairly
novice
programmer.
--
SS


"RB Smissaert" wrote:

This will give you the screen resolution:

Option Explicit
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Const SM_CYCAPTION = 4
Private Const SM_CXBORDER = 5
Private Const SM_CYBORDER = 6
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const SM_CXVIRTUALSCREEN As Long = 78
Private Const SM_CMONITORS As Long = 80
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long

Sub getScreenResolution(lWidth As Long, lHeight As Long)
lWidth = GetSystemMetrics(SM_CXSCREEN)
lHeight = GetSystemMetrics(SM_CYSCREEN)
End Sub

Sub test()
Dim lWidth As Long
Dim lHeight As Long
getScreenResolution lWidth, lHeight
MsgBox lWidth & " x " & lHeight, , "screen resolution"
End Sub


RBS


"StevenS" wrote in message
...
I have written a drawing programme in excel to produce floor plans &
elevations for sheds. I now want to distribute the programme but need
to
have
all of the scaling to change to the current users screen size. I am
after
ways of VB knowing what screen size the user has & how I can set my
page
tops
etc. to suit this so the shapes are positioned correctly on the page.
At
the
moment I have hard coded in where my shapes are to start positioning
but
this
is no good when a new user has a different monitor size as it throws it
all
over the screen.

Also am looking for ways of locking users out of code and creating
distributor versions so that we have the ability to monitor how they
are
using there programme & what they are using it for.

Urgent help required.

thanks
--
SS




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to programme this in excel? Sherees Excel Discussion (Misc queries) 4 December 15th 09 09:22 PM
Why I can copy nothing from excel to word or other programme? Henry Excel Worksheet Functions 0 July 9th 08 10:01 AM
need to find a excel programme for rota's Mike McDonagh Excel Discussion (Misc queries) 1 August 29th 06 03:07 PM
Excel Programme Management donnawales Excel Discussion (Misc queries) 1 April 8th 06 03:01 PM
excel vba programme sarasa[_6_] Excel Programming 3 June 14th 04 07:27 AM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"