Close excel file

Hi All,

I copy data from one excel file to another.Once the copy is done,I would like to close the file from which I copied the data.
Any commands for this one?




  • Yep it's just a simple:

    [red] Workbooks(sname).Close [/red]

    Where sname is the name (or you can use index instead) of the workbook to close. If you open up the bracket after the word close you will see a list of further options. Dai.

    Do or do not, there is no try. |
  • Hi Dai,

    Thakns for the quick response.I did try the Workbooks(sname).Close after the Paste but when i run the macro it goes to debug and stops at this line.
    Please advise.


  • You must use the name of your workbook inside the bracket enclosed with parenthesis
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!