Results 1 to 6 of 6

Thread: I want to delete a workbook using code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    france
    Posts
    71

    Resolved I want to delete a workbook using code

    is it possible

    thanks anyway
    Last edited by writelearner; Sep 22nd, 2004 at 09:51 AM.

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Yes.

    Kill "<filepath" <<< Deletes the file

    To delete a worksheet (outside excel vb/vba)
    <object refering to excel application>.<workbook>.sheets("<sheetname").delete

    Inside excel vba
    activesheet.delete
    or
    activeworkbook.sheets("<sheet name>").delete



    Try one of those


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    france
    Posts
    71
    lets kill them all

    thanks a lot

    er maybe you know how to create a folder too

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    mkdir - make directory/folder
    rmdir - remove folder
    open - open a file or create one
    close - close the channel of an open file
    kill - delete file (not put in wastebasket!! - look up api to put in wastebasket)
    print - prints a string to a file
    line input - inputs a line from an open file
    get - get byte(s) from a file
    put - put byte(s) into a file

    You'll have to search the help files for proper usage.

    Make sure you back up everything.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    france
    Posts
    71

    solved

    thanks a lot. it will be usefull

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    france
    Posts
    71

    I want to delete a workbook using code resolved

    thanks a again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width