ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Moving from one Excel File to Another (https://www.excelbanter.com/excel-programming/313574-moving-one-excel-file-another.html)

Kevin

Moving from one Excel File to Another
 
I have an application I am working on that has a Menu which is contained in
an Excel Workbook with supporting VBA and no data. I open this workbook then
select one of the following two options:

1. Choose to open a new workbook. - This option creates a new workbook based
on a template I have created.
2. Choose to open an existing workbook.

This works fine. The problem I am having is after I work in either a new
workbook (and save it) or make changes in an existing wqorkbook (and save
Changes) I may want to return to the menu. Toward this end I have a button on
an input form to "Return to Menu". When I execute the code behind this button
it opens the menu workbook again and then closes the workbook containing the
data. The menu form appears, but the form from the data workbook does not
disappear. The workboiok is closed so I suspect it is a problem with
redrawing the screen. The only command I find in VBA which appears to address
this issue applies to the Form object and does nothing to resolve this issue.

Any ideas? Is the an API call that will do it and if so what would the code
look like?

Any help would be greatly appreciated!

Kevin

Dave Peterson[_3_]

Moving from one Excel File to Another
 
Just a wild guess...

You unloaded the form, but screenupdating was set to false.

Maybe change the screenupdating to true, unload the form, and then back to
screenupdating = false.



Kevin wrote:

I have an application I am working on that has a Menu which is contained in
an Excel Workbook with supporting VBA and no data. I open this workbook then
select one of the following two options:

1. Choose to open a new workbook. - This option creates a new workbook based
on a template I have created.
2. Choose to open an existing workbook.

This works fine. The problem I am having is after I work in either a new
workbook (and save it) or make changes in an existing wqorkbook (and save
Changes) I may want to return to the menu. Toward this end I have a button on
an input form to "Return to Menu". When I execute the code behind this button
it opens the menu workbook again and then closes the workbook containing the
data. The menu form appears, but the form from the data workbook does not
disappear. The workboiok is closed so I suspect it is a problem with
redrawing the screen. The only command I find in VBA which appears to address
this issue applies to the Form object and does nothing to resolve this issue.

Any ideas? Is the an API call that will do it and if so what would the code
look like?

Any help would be greatly appreciated!

Kevin


--

Dave Peterson


Kevin

Moving from one Excel File to Another
 
Dave,

Thanks! I'll look at that! I will post back if that does not correct the
problem.

Thanks again! :-)

"Dave Peterson" wrote:

Just a wild guess...

You unloaded the form, but screenupdating was set to false.

Maybe change the screenupdating to true, unload the form, and then back to
screenupdating = false.



Kevin wrote:

I have an application I am working on that has a Menu which is contained in
an Excel Workbook with supporting VBA and no data. I open this workbook then
select one of the following two options:

1. Choose to open a new workbook. - This option creates a new workbook based
on a template I have created.
2. Choose to open an existing workbook.

This works fine. The problem I am having is after I work in either a new
workbook (and save it) or make changes in an existing wqorkbook (and save
Changes) I may want to return to the menu. Toward this end I have a button on
an input form to "Return to Menu". When I execute the code behind this button
it opens the menu workbook again and then closes the workbook containing the
data. The menu form appears, but the form from the data workbook does not
disappear. The workboiok is closed so I suspect it is a problem with
redrawing the screen. The only command I find in VBA which appears to address
this issue applies to the Form object and does nothing to resolve this issue.

Any ideas? Is the an API call that will do it and if so what would the code
look like?

Any help would be greatly appreciated!

Kevin


--

Dave Peterson



Kevin

Moving from one Excel File to Another
 
Dave,

Thanks! I'll check that and post back if that does not correct the problem.
I am at home now and will have to pull out the work laptop to try it!

Thanks again!

Kevin

"Dave Peterson" wrote:

Just a wild guess...

You unloaded the form, but screenupdating was set to false.

Maybe change the screenupdating to true, unload the form, and then back to
screenupdating = false.



Kevin wrote:

I have an application I am working on that has a Menu which is contained in
an Excel Workbook with supporting VBA and no data. I open this workbook then
select one of the following two options:

1. Choose to open a new workbook. - This option creates a new workbook based
on a template I have created.
2. Choose to open an existing workbook.

This works fine. The problem I am having is after I work in either a new
workbook (and save it) or make changes in an existing wqorkbook (and save
Changes) I may want to return to the menu. Toward this end I have a button on
an input form to "Return to Menu". When I execute the code behind this button
it opens the menu workbook again and then closes the workbook containing the
data. The menu form appears, but the form from the data workbook does not
disappear. The workboiok is closed so I suspect it is a problem with
redrawing the screen. The only command I find in VBA which appears to address
this issue applies to the Form object and does nothing to resolve this issue.

Any ideas? Is the an API call that will do it and if so what would the code
look like?

Any help would be greatly appreciated!

Kevin


--

Dave Peterson




All times are GMT +1. The time now is 12:06 AM.

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