Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Workbook_OPEN 2

Status
Not open for further replies.

vttech

Technical User
Jan 28, 2006
297
US
I place the following code

Private Sub Workbook_Open()
Load frmDataInput
End Sub


I thought that this would load the form call frmDataInput first when the user open the excel file but it's not working. what am I doing wrong??
 
Code:
Private Sub Workbook_Open()
   frmDataInput.Show
End Sub


Regards,
Mike
 
Thanks that works, but I have another question in regards to this form I can see the form name(frmDataInput)in the left side of the VBA editor but when I go to the drop down list to choose the form the only option I have is workbook and the userform does not show up as an option. I am trying to to get userform_initialize.

any ideas??
 
Double-Click on the Userform name/icon in the Project Explorer window (left-hand side of VBE) or click once then click on the "Code" icon between the tree-view and title bar of the Project Explorer window. You will be able to select Userform from the left dropdown now.


Regards,
Mike
 
Thanks,

I noticed that the spreadsheet shows up in the background when the excel file is opened. I just want the form to show up not the worksheet in the background. Can I suppress this behavior until the user completes the form.
 
Well, you cannot make the worksheet invisible (at least one sheet must be visible in a normal workbook, although no sheets visible in an Add-In), but you could initially display a blank sheet without gridlines then switch to the relevant sheet when the form is closed.


Mike
 
Private Sub Workbook_Open()
Windows(1).Visible = False
frmDataInput.Show
Windows(1).Visible = True
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
<quote>but you could initially display a blank sheet without gridlines then switch to the relevant sheet when the form is closed</quote>

cool

another question I used the following code

Private Sub cmdOK_Click()
C7.Value = txtName.Value
Unload Me
End Sub

I wanted to the value that the person inputs in the text box call txtname into cell c7 but I keep getting an error

any ideas??
 
One way:
Code:
Private Sub cmdOK_Click()
  [b][[/b]C7[b]][/b].Value = txtName.Value
  Unload Me
End Sub


Mike
 
Perhaps this ?
ActiveSheet.Range("C7").Value = txtName.Value

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top