• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How can i save and close the first workbook after opening second workbook from i

ravikumar00008

New Member
Hi All,


How can i do like this.


I am opening second workbook from the first workbook at that time how can i save and close the first workbook.


So, that one workbook should open at a time.


This is how i tried but not succeeded.

[pre]
Code:
Application.Workbooks.Open ("E:Second_Data.xlsx")
Application.Workbooks("E:First_Data.xlsx").Save
Application.Workbooks("E:First_Data.xlsx").Close
[/pre]
Thanks in advance


Regards

Kumar
 
Since the code is contained in the first workbook, this will only work if the close command is the last thing you want done.

Note, it's a backtick (above the tab key) to post code, not a single apostrophe.

[pre]
Code:
Application.Workbooks.Open ("E:Second_Data.xlsx")
ThisWorkbook.Save
ThisWorkbook.Close
[/pre]
 
Back
Top