Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2000: maximise a sizeable form?

Hello all

I have set a form to be resizeable, and I would like to give my users the
opportunity
to choose to have this form to start in a maximised state.

How would I do that?

Thanks

BTW I just realised that I am crossposting with the
microsoft.public.office.developer.vba newsgroup. My fault, my apologies to
all.

Philippe
http://uk.geocities.com/philippeoget


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Excel 2000: maximise a sizeable form?

Basically you need an independent place to store data that
your macro can draw from each time it starts. Here's one
way to do what you are looking for. See my further
comments at the end.

Sub MainMacro()
On Error GoTo 88
Workbooks.Open Filename:= _
"C:\Documents and Settings\My Documents\UserPrefs.xls"
UserForm1.Height = Range("A1").Value
UserForm1.Width = Range("A2").Value
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
If NeverTrue = 3.14 Then
88 UserForm1.Height = 50
UserForm1.Width = 125
End If
UserForm1.Show
End Sub

Private Sub Maximize_Click()
On Error GoTo 99
Workbooks.Open Filename:= _
"C:\Documents and Settings\My Documents\UserPrefs.xls"
If NeverTrue = 3.14 Then
99 Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\My
Documents\UserPrefs.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False _
, CreateBackup:=False
End If
Range("A1").Value = 200
Range("A2").Value = 200
UserForm1.Height = 200
UserForm1.Width = 200
ActiveWorkbook.Save
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub

Private Sub Minimize_Click()
On Error GoTo 99
Workbooks.Open Filename:= _
"C:\Documents and Settings\My Documents\UserPrefs.xls"
If NeverTrue = 3.14 Then
99 Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\My
Documents\UserPrefs.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="" _
, ReadOnlyRecommended:=False _
, CreateBackup:=False
End If
Range("A1").Value = 50
Range("A2").Value = 125
UserForm1.Height = 50
UserForm1.Width = 125
ActiveWorkbook.Save
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub

1) You could save the "UserPrefs" file anywhere on the
user's drive just so long as it will not be deleted or
moved.
2) "Maximize"(or -ise) and "Minimize" are the buttons I
put on my tester userform. You will need to put that code
into the userform code area.

I liked that question. Thank you.

-IA


-----Original Message-----
Hello all

I have set a form to be resizeable, and I would like to

give my users the
opportunity
to choose to have this form to start in a maximised state.

How would I do that?

Thanks

BTW I just realised that I am crossposting with the
microsoft.public.office.developer.vba newsgroup. My

fault, my apologies to
all.

Philippe
http://uk.geocities.com/philippeoget


.

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
Excel window - keyboard shortcut for maximise Madiya Excel Discussion (Misc queries) 2 May 25th 09 06:50 AM
how can i print a form/s that are in excel 2000 dataforms? nuschus Excel Discussion (Misc queries) 2 November 8th 05 05:26 PM
In excel: when in print preview, 1 button to 'maximise margins' Sa Gested Excel Worksheet Functions 0 August 3rd 05 01:46 PM
Accessing the values of form controls on worksheets in Excel 2000 robbinma Excel Programming 2 August 28th 03 08:35 AM
Excel 2000 VBA Form Combobox value Matt. Excel Programming 2 July 25th 03 06:37 PM


All times are GMT +1. The time now is 01:50 PM.

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

About Us

"It's about Microsoft Excel"