Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chi Chi is offline
external usenet poster
 
Posts: 69
Default open and close files

Hi,

Would you please help me to code? Thanks.
I have two files: A and B.
I open the file A to enter new information and then close it. As soon as I
close the file A, I would like the file B opens by itself. Please help

Thank you!
Chi

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default open and close files

Hi,

In Book A Alt+f11 to open VB editor and double click 'ThisWorkbook"

Paste the code below in on the right and change the path and name to the
workbook you want to open when Book A closes.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Workbooks.Open Filename:="C:\book1.xls"
End Sub

Mike
"Chi" wrote:

Hi,

Would you please help me to code? Thanks.
I have two files: A and B.
I open the file A to enter new information and then close it. As soon as I
close the file A, I would like the file B opens by itself. Please help

Thank you!
Chi

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chi Chi is offline
external usenet poster
 
Posts: 69
Default open and close files

Hi Mike,

I would like to say THANK YOU for your help! It is cool to see it works!!
Sorry, I did not mention that the file A is a template file (xltx).
Therefore, it works only once.

Please help
Thanks
Chi


"Mike H" wrote:

Hi,

In Book A Alt+f11 to open VB editor and double click 'ThisWorkbook"

Paste the code below in on the right and change the path and name to the
workbook you want to open when Book A closes.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Workbooks.Open Filename:="C:\book1.xls"
End Sub

Mike
"Chi" wrote:

Hi,

Would you please help me to code? Thanks.
I have two files: A and B.
I open the file A to enter new information and then close it. As soon as I
close the file A, I would like the file B opens by itself. Please help

Thank you!
Chi

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked PDF files open briefly and then close Stella Rivera Excel Discussion (Misc queries) 2 January 27th 09 04:02 PM
How to open a list of excel files and get update, then close it? Eric Excel Discussion (Misc queries) 4 June 10th 07 08:58 AM
fix for open/close files problem Patricia Shannon Excel Discussion (Misc queries) 0 April 25th 06 04:21 PM
fix for open/close files problem Patricia Shannon New Users to Excel 0 April 25th 06 04:21 PM
Hyperlinks to files open and then close instantaneously Rford626 Excel Discussion (Misc queries) 0 March 6th 06 10:30 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"