Macro to open a workbook, work in that workbook, than close the workbook (saved) 
Author Message
 Macro to open a workbook, work in that workbook, than close the workbook (saved)

Hello everyone,

I have a very tricky problem to solve: I want to create a marco, that
opens a user specified workbook, lets the user make changes in the
workbook and than, by click on a automatically created button in this
workbook saves an closes the workbook. After that action, the old macro
has to be resumed. Did I explain my problem good enough?

I would be very happy if anyone has an answere for me!

Thank you!

Justin Heindorf




Wed, 18 Jun 1902 08:00:00 GMT  
 Macro to open a workbook, work in that workbook, than close the workbook (saved)
The macro would have to be broken into two parts.  The macro has to end for
the user to work in the freshly opened workbook.

You can see how to add the button by using the macro recorder.  Use a button
from the Forms toolbar and you can then use the onaction property to assign
the button to a macro in the original workbook.  Then when the button is
pressed, you can use it to trigger your macro.  You will have to do extra
work to guard against the user closing the workbook in any other fashion.

To allow the user to specify a workbook to open look at the

Application.GetOpenfileName
method.

Regards,
Tom Ogilvy
MVP Excel

Quote:

>Hello everyone,

>I have a very tricky problem to solve: I want to create a marco, that
>opens a user specified workbook, lets the user make changes in the
>workbook and than, by click on a automatically created button in this
>workbook saves an closes the workbook. After that action, the old macro
>has to be resumed. Did I explain my problem good enough?

>I would be very happy if anyone has an answere for me!

>Thank you!

>Justin Heindorf





Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Disabling a closed workbook from an open workbook

2. Copying Sheets from a closed workbook into an open workbook

3. Opening/closing workbook from UserForm in another workbook

4. Macro to check workbook name on save against original workbook name

5. Macro to save a workbook as a name entered in a cell in the workbook

6. Closing 1 workbook closes all workbooks

7. Excel97 Opening workbook macro when the workbook is password protected for modifying

8. copy sheets to new workbook, name new workbook by cell value then mail workbook

9. Realtime Linking from one open workbook to another open workbook

10. Opening Any Workbook in Excel Also Opens A Different Workbook


 
Powered by phpBB® Forum Software © phpBB Group