View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Only Show User Form Once

Cornish,

Suggestion.

Write a flag/switch to the registry when that form completes. In your
workbook open code, test the flag in the registry, if set, don't show the
form. You can use GetSetting and SaveSetting as simple registry read/writes.
The flag could be set with#

SaveSetting appname:="MyApp", _
section:=ActiveWorkbook.Name, _
key:="FirstTime", _
setting:="False"

and the open code would be something like

Private Sub Workbook_Open()
Dim sFlag As String

On Error Resume Next
sFlag = GetSetting(appname:="MyApp", _
section:=ActiveWorkbook.Name, _
key:="FirstTime")
On Error GoTo 0

If sFlag < "False" Then
Quote_Details.Show
End If

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"cornishbloke" wrote in message
...
Hi, once again I turn to this forum for help!

I have a workbook template (*.xlt) which, upon opening displays a
userform ("Quote_Details") into which the user enters details
(contractor name, quote number etc) of the quote they are about to
create. Once completed and the OK button is pressed this information
is sent to various places in the workbook, including headers, footers
and various cells.

The problem is that after the quote has been completed and saved it
still shows the "Quote_Details" userform upon opening.

I need the userform to only appear the first time a copy of the
template is opened and not after the copy has been named and saved. Is
this possible?

Any suggestions would be greatly appreciated.


---
Message posted from http://www.ExcelForum.com/