View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RPIJG[_59_] RPIJG[_59_] is offline
external usenet poster
 
Posts: 1
Default Userform show problem...

I'm having a problem with my userform not showing. I'll explain her
with some code. in the Workbook_Open procedure I have...


Code
-------------------
Sub Workbook_open()
Unload Controls
If ActiveWorkbook.Path = "" And Left(ActiveWorkbook.Name, 4) < "Book" Or ActiveWorkbook.FileFormat = xlTemplate Then
Dim ans3
ans3 = MsgBox("Do you really want to create a new invoice? Once created the Invoice number is final. ", vbYesNo, "FINAL!!! Create New Invoice?")
If ans3 = vbYes Then
Dim InvNo&
'Do not assign new inv nbr if the original template has been opened
If ActiveWorkbook.Path = "" And Left(ActiveWorkbook.Name, 4) < "Book" Or ActiveWorkbook.FileFormat = xlTemplate Then
'If O3 does not contain anything, enter the next inv nbr
If [P3] = "" Then
'Get next inv nbr
InvNo = GetSetting("XLInvoices", "Invoices", "CurrentNo", 1000) + 1
'Enter the inv nbr in A1
[P3] = InvNo
'Save the inv nbr
SaveSetting "XLInvoices", "Invoices", "CurrentNo", InvNo
'Put todays date in O4
[P4] = Date
End If
End If
End If
End If
If ans3 = vbNo Then
Application.Quit
End If
If ActiveWorkbook.Path = "" And Left(ActiveWorkbook.Name, 4) < "Book" Or ActiveWorkbook.FileFormat = xlTemplate Then
ActiveWorkbook.Sheets("Product List").Visible = False
ActiveWorkbook.Sheets("CustomerInfo").Visible = False
Else
ActiveWorkbook.Sheets("Product List").Visible = False
ActiveWorkbook.Sheets("CustomerInfo").Visible = False
End If
If ActiveWorkbook.Path = "" And Left(ActiveWorkbook.Name, 4) < "Book" Or ActiveWorkbook.FileFormat = xlTemplate Then
Dim FromQuote
FromQuote = MsgBox("Are you importing from the QuoteMaker?", vbYesNo, "Import from QuoteMaker?")
If FromQuote = vbYes Then Exit Sub
If FromQuote = vbNo Then
InfoPagesInvoice.Show
End If
Else: Exit Sub
End If
End Su
-------------------


And when I first open the template this works exactly like it i
supposed to, and the userform shows...however, when I go through th
rest of the process, and then finally save the template as .xlt an
call the workbook_open procedure again everything works except for th
userform being shown. There is no error code either, it just simpl
doesn't show. Anyone have any ideas

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