Results 1 to 4 of 4
  1. #1
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43

    How to delete an Excel workbook using MsAccess VBA


    If a File exists in CurrentProject.Path & "\Book1.xlsx" , I want to delete it
    and create a new file . How can I do it using MsAccess vba . Please help !

    Also how to create a new Workbook Book1.xlsx with only one WorkSheet called Sheet1

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Use Kill. Example:

    Kill CurrentProject.Path & "\Book1.xlsx"

    Bing: Access VBA create Excel file
    http://www.tech-archive.net/Archive/.../msg00164.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by baba View Post
    ...
    Also how to create a new Workbook Book1.xlsx with only one WorkSheet called Sheet1
    Here is an example. You will need to add a save command with the path.
    https://www.accessforums.net/access/...tml#post280600

  4. #4
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43
    Thanks for the response. this helps

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-27-2014, 02:27 PM
  2. Add VBA code to an Exported Excel Workbook
    By gasmaskman in forum Programming
    Replies: 13
    Last Post: 02-11-2014, 10:00 AM
  3. Opening Excel Workbook From Access with VBA
    By kestefon in forum Access
    Replies: 4
    Last Post: 01-31-2014, 06:51 PM
  4. Replies: 4
    Last Post: 12-17-2012, 01:21 PM
  5. Link to Excel Workbook
    By Shelly9633 in forum Access
    Replies: 2
    Last Post: 01-06-2012, 10:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums