ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   closing form w/ Maco (https://www.excelbanter.com/excel-programming/301889-closing-form-w-maco.html)

jeffP

closing form w/ Maco
 
Here's my minor dilemma, hope you can help.
I have two workbooks. From workbook(1) I open WB(2)where
I'm going to copy a sheet and paste it to WB(1). My
problem is that I have a form that opens when the sheet is
activated.
I recorded a macro to do this but it stops when the form
opens (and continues when I close it). It's not a big deal
but I'd like a more seamless operation.

Any help is appreciated.
JeffP


Earl Kiosterud[_3_]

closing form w/ Maco
 
Jeff,

Is this a UserForm? The macro has no control while a UserForm is open, one
exception when the form is shown modeless. Then the macro that showed it
will keep running, can end, and your original macro that opened the workbook
will regain control.

From your other post, I gather this form shows automatically when the sheet
is selected. Perhaps you can change the macro that shows the form so that
it shows it when a button is clicked instead.

Provide more info.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"jeffP" wrote in message
...
Here's my minor dilemma, hope you can help.
I have two workbooks. From workbook(1) I open WB(2)where
I'm going to copy a sheet and paste it to WB(1). My
problem is that I have a form that opens when the sheet is
activated.
I recorded a macro to do this but it stops when the form
opens (and continues when I close it). It's not a big deal
but I'd like a more seamless operation.

Any help is appreciated.
JeffP




Jeffp

closing form w/ Maco
 
Earl,
Actually, I have two separate problems w/ UserForms (are
there other kinds of forms?).
This form is in Book(1) and runs by this

Private Sub Workbook_Open()
frm_start.Show
End Sub

I'm using a macro in Book(2) to open Book(1) select a
sheet and copy some cells , go back to Book(2) paste and
then close Book(1). It works fine except when Book(1)
opens of course the userform shows and the macro pauses
until I close the form w/ a click. What I want is to put a
piece of code in my macro that , when it reaches Book(1)
and the form it says "frm_start.unshow" but , as I'm sure
you know, there is no "unshow". I still want the form to
open when someone opens the workbook , just not when I'm
importing!
BTW, please re-read my other post. It is a different
problem. THis is a userform that opens whenever the sheet
is opened and I want it to until the user gets sick of it.
Thanks for you help.
jeffP

-----Original Message-----
Jeff,

Is this a UserForm? The macro has no control while a

UserForm is open, one
exception when the form is shown modeless. Then the

macro that showed it
will keep running, can end, and your original macro that

opened the workbook
will regain control.

From your other post, I gather this form shows

automatically when the sheet
is selected. Perhaps you can change the macro that shows

the form so that
it shows it when a button is clicked instead.

Provide more info.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"jeffP" wrote in message
...
Here's my minor dilemma, hope you can help.
I have two workbooks. From workbook(1) I open WB(2)where
I'm going to copy a sheet and paste it to WB(1). My
problem is that I have a form that opens when the sheet

is
activated.
I recorded a macro to do this but it stops when the form
opens (and continues when I close it). It's not a big

deal
but I'd like a more seamless operation.

Any help is appreciated.
JeffP



.


Tom Ogilvy

closing form w/ Maco
 
Application.EnableEvents = False
workbooks.Open "C:\my data\Book1.xls"
Application.EnableEvents = True

will prevent the userform from showing. It is best to use the term
userform. Many people use the word form to refer to a rendition of a paper
form on a worksheet - it is not always clear what the situation is when
using just the term form.

--
regards,
Tom Ogilvy

"jeffP" wrote in message
...
Earl,
Actually, I have two separate problems w/ UserForms (are
there other kinds of forms?).
This form is in Book(1) and runs by this

Private Sub Workbook_Open()
frm_start.Show
End Sub

I'm using a macro in Book(2) to open Book(1) select a
sheet and copy some cells , go back to Book(2) paste and
then close Book(1). It works fine except when Book(1)
opens of course the userform shows and the macro pauses
until I close the form w/ a click. What I want is to put a
piece of code in my macro that , when it reaches Book(1)
and the form it says "frm_start.unshow" but , as I'm sure
you know, there is no "unshow". I still want the form to
open when someone opens the workbook , just not when I'm
importing!
BTW, please re-read my other post. It is a different
problem. THis is a userform that opens whenever the sheet
is opened and I want it to until the user gets sick of it.
Thanks for you help.
jeffP

-----Original Message-----
Jeff,

Is this a UserForm? The macro has no control while a

UserForm is open, one
exception when the form is shown modeless. Then the

macro that showed it
will keep running, can end, and your original macro that

opened the workbook
will regain control.

From your other post, I gather this form shows

automatically when the sheet
is selected. Perhaps you can change the macro that shows

the form so that
it shows it when a button is clicked instead.

Provide more info.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"jeffP" wrote in message
...
Here's my minor dilemma, hope you can help.
I have two workbooks. From workbook(1) I open WB(2)where
I'm going to copy a sheet and paste it to WB(1). My
problem is that I have a form that opens when the sheet

is
activated.
I recorded a macro to do this but it stops when the form
opens (and continues when I close it). It's not a big

deal
but I'd like a more seamless operation.

Any help is appreciated.
JeffP



.




Earl Kiosterud[_3_]

closing form w/ Maco
 
Jeff,

Another possible solution, depending on what's in the workbook is to link to
it from Book 2. Book 1 doesn't even have to open for that. If you're
looking through a table, perhaps use with VLOOKUP.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"jeffP" wrote in message
...
Earl,
Actually, I have two separate problems w/ UserForms (are
there other kinds of forms?).
This form is in Book(1) and runs by this

Private Sub Workbook_Open()
frm_start.Show
End Sub

I'm using a macro in Book(2) to open Book(1) select a
sheet and copy some cells , go back to Book(2) paste and
then close Book(1). It works fine except when Book(1)
opens of course the userform shows and the macro pauses
until I close the form w/ a click. What I want is to put a
piece of code in my macro that , when it reaches Book(1)
and the form it says "frm_start.unshow" but , as I'm sure
you know, there is no "unshow". I still want the form to
open when someone opens the workbook , just not when I'm
importing!
BTW, please re-read my other post. It is a different
problem. THis is a userform that opens whenever the sheet
is opened and I want it to until the user gets sick of it.
Thanks for you help.
jeffP

-----Original Message-----
Jeff,

Is this a UserForm? The macro has no control while a

UserForm is open, one
exception when the form is shown modeless. Then the

macro that showed it
will keep running, can end, and your original macro that

opened the workbook
will regain control.

From your other post, I gather this form shows

automatically when the sheet
is selected. Perhaps you can change the macro that shows

the form so that
it shows it when a button is clicked instead.

Provide more info.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"jeffP" wrote in message
...
Here's my minor dilemma, hope you can help.
I have two workbooks. From workbook(1) I open WB(2)where
I'm going to copy a sheet and paste it to WB(1). My
problem is that I have a form that opens when the sheet

is
activated.
I recorded a macro to do this but it stops when the form
opens (and continues when I close it). It's not a big

deal
but I'd like a more seamless operation.

Any help is appreciated.
JeffP



.





All times are GMT +1. The time now is 04:53 AM.

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