Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a Qlikview Document that tracks files and folders.
I have buttons that can open the file or the Directory.
I am looking for a Macro that can delete a file I have selected
Thanks
Alan
This is what works
See this document:Useful Qlikview Macros
Thanks G,
I found this and it works
FUNCTION DeleteFile(rFile)
set oFile = createObject("Scripting.FileSystemObject")
currentStatus = oFile.FileExists(rFile)
if currentStatus = true then
oFile.DeleteFile(rFile)
end if
set oFile = Nothing
END FUNCTION
SUB CallExample
DeleteFile ("C:\MyFile.PDF")
END SUB
but I want it to delete a file I have selected from a Straight Table
like here
I reckoned you already knew how to get the values from a field in a macro. Here's a bit from the api guide:
set doc = ActiveDocument
set mySelections = doc.fields("Field").GetSelectedValues
for i = 0 to mySelections.Count - 1
msbox mySelections.Item(i).text
next
Perhaps activedocument.fields("Full Path").getselectedvalues.item(0).text is enough to get the value you want.
Thanks G,
I think I may have it now
Thanks
Actually I don't have it working.
Not sure what the issue is.
I have attached the qvw, would reallyappreciate if you could help get it working thanks G
Just realised the QVW is no help to you!!
Well, I can't actually delete the file, but if I select the file in the field Full Path first then I can use a msgbox to echo the file name. So that part works.
This is what works