Data Form

  • Thread starter Thread starter Slim Slender
  • Start date Start date
S

Slim Slender

I can have the built-in data form open with the workbook with:

Private sub Workbook_Open()
ActiveSheet.ShowDataForm
End Sub

The data form appears to be modal so I can't do anything else
until it is closed. Can I have the event of closing the data form
cause the workbook to be saved and close?
 
This should do it:

Private sub Workbook_Open()
ActiveSheet.ShowDataForm
Me.Close True
End Sub
 
Try this:

Private sub Workbook_Open()
ActiveSheet.ShowDataForm
ThisWorkbook.Close true
End Sub
 
Thanks guys. Both of those work. But, just one problem.
Be careful what you ask for. It appears that I'll never be
able to do anything with such a file other than use the
data form. I can't get to the sheet or the VBE because
the file closes as soon as the form is dismissed.
Someone at work suggested this to protect a worksheet
form nin-compoops but this ain't the way.
 
Slim Slender formulated on Tuesday :
Thanks guys. Both of those work. But, just one problem.
Be careful what you ask for. It appears that I'll never be
able to do anything with such a file other than use the
data form. I can't get to the sheet or the VBE because
the file closes as soon as the form is dismissed.
Someone at work suggested this to protect a worksheet
form nin-compoops but this ain't the way.

Can you possibly hide the sheet and use the data form while some other
sheet is active?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top