Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
hopkinsc
Valued Contributor II

Help with Macro

Hi all

I have a macro that exports an object into excel and saves it and emails it to multiple recipients.

Can anyone tell me what command i would use to also delete the file please?

Here is the Export part of the macro.

Sub Export1
theDate = Right(String(2,"0") &  Day(Now()),2) _
        & Right(String(2,"0") & month(Now()),2) _
        & Year(Now())

ActiveDocument.ClearAll false
pathcorp="C:\TEST\"
set corp = ActiveDocument.GetSheetObject("TB05")
corp.ExportBiff  pathcorp & "TEST - " & theDate & ".xls"

set MyTable = ActiveDocument.GetSheetObject("TB05")
path="C:\TEST\"
   
Set XLApp = Nothing
Set Table = Nothing

Many thanks

Chris

1 Reply
mwoolf
Honored Contributor II

Re: Help with Macro

When I google vbscript delete file, I find:

Set obj = CreateObject("Scripting.FileSystemObject") 'Calls the File System Object 

obj.DeleteFile("C:\MyFolder\MyFile.txt") 'Deletes the file throught the DeleteFile function

Community Browser