Howdy, Stranger!

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

Categories

Close excel file

ikrikumarikrikumar Member Posts: 6
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?

Thanks.

Regards,
Krishna

Comments

  • DaiMitnickDaiMitnick Member Posts: 77
    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. |
    ------------------------------------------
  • ikrikumarikrikumar Member Posts: 6
    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.

    Thanks.

    Regards,Krishna
  • bohemian9485bohemian9485 Member Posts: 1
    You must use the name of your workbook inside the bracket enclosed with parenthesis
Sign In or Register to comment.