Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro Import (2003)

    I have a macro that inputs the data from an Excel Spreadsheet into a specific table. I have a batch file that runs this nightly. Currently, I have to replace the Excel file with a new blank file so the import doesn't grab duplicate results. Is it possible to have the macro delete the results in the Excel spreadsheet after it has imported the results into the Access table? Thanks in advance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro Import (2003)

    You can't do this in a macro, at least not using macro commands. To clear an Excel worksheet from Excel, you need VBA code. You can call this code from the macro.

    Wouldn't it be easier to delete the Excel workbook? If you do it all in VBA code, you can add an error handler to avoid the error message you'd get if the workbook is not present when the code is run.

Posting Permissions

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