Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

souadouert
Contributor III

Create folder with macro


I used this macro to create folder and i give the system access , But the folder didnt create and i have not any error

SUB folder()


set Var = ActiveDocument.GetVariable("D:\TEST")


dim filesys, newfolder, newfolderpath


newfolderpath = Var.GetContent.String


set filesys=CreateObject("Scripting.FileSystemObject")


If Not filesys.FolderExists(newfolderpath) Then


   Set newfolder = filesys.CreateFolder(newfolderpath)


   msgbox("A new folder has been created at: " & newfolderpath)


End If


END SUB

1 Solution

Accepted Solutions

Re: Create folder with macro

Are you sure that you have variable with the name of "D:\TEST" and that they contained a valid path? I assume that this is rather your aimed target-path and not a variable. Therefore go into the gui and create there a variable maybe "FolderPath" and assign "D:\TEST" as value and it should work with:


...

set Var = ActiveDocument.GetVariable("FolderPath")

...


- Marcus

1 Reply

Re: Create folder with macro

Are you sure that you have variable with the name of "D:\TEST" and that they contained a valid path? I assume that this is rather your aimed target-path and not a variable. Therefore go into the gui and create there a variable maybe "FolderPath" and assign "D:\TEST" as value and it should work with:


...

set Var = ActiveDocument.GetVariable("FolderPath")

...


- Marcus

Community Browser