ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data Form (https://www.excelbanter.com/excel-programming/444191-data-form.html)

Slim Slender[_3_]

Data Form
 
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?

Jim Rech[_4_]

Data Form
 
This should do it:

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

"Slim Slender" wrote in message
...
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?



AB[_2_]

Data Form
 
Try this:

Private sub Workbook_Open()
ActiveSheet.ShowDataForm
ThisWorkbook.Close true
End Sub

On Feb 1, 10:23*am, Slim Slender wrote:
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?



Slim Slender[_3_]

Data Form
 
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.

GS[_2_]

Data Form
 
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?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc



Slim Slender[_3_]

Data Form
 
On Feb 1, 9:57*pm, GS wrote:
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?

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


That's the ticket!


All times are GMT +1. The time now is 01:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com