Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I wrote a macro that creates a folder into a specific location.
When Testing (with Debug) the macro in QV, it works, and the folder is created.
Now, I need to somehow call the function during script execution.
I tried something like below, but it isn't working.
How can I work it around?
Thanks in advance,
Aldo.
Sub CreateFolder
fsoCreateFolder()
End Sub
Call CreateFolder;
Function fsoCreateFolder()
Dim objFSO
Dim objFolder
Dim Overwrite
Dim FolderName: FolderName = "BKS11"
Dim FolderPath: FolderPath = "C:\Temp"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Overwrite = objFSO.FolderExists(FolderPath & "" & FolderName)
Select Case Overwrite
Case False: Set objFolder = objFSO.CreateFolder(FolderPath & "" & FolderName)
Case Else
End Select
Set objFSO = Nothing: Set objFolder = Nothing
End Function
'----------------------
The function below (and the call) are actually working.
Thanks,
Aldo.
Function fsoCreateFolder(FolderPath, FolderName) '(FolderName, FolderPath)
'Function Tested!
'Call the function as below:
'load fsoCreateFolder('$(vRootDir)', 'Created Folder No 1') autogenerate 1;
Dim objFSO
Dim objFolder
Dim Overwrite
Set objFSO = CreateObject("Scripting.FileSystemObject")
Overwrite = objFSO.FolderExists(FolderPath & "\" & FolderName)
Select Case Overwrite
Case False: Set objFolder = objFSO.CreateFolder(FolderPath & "\" & FolderName)
Case Else
End Select
Set objFSO = Nothing: Set objFolder = Nothing
End Function
Try something like that:
let someVariable = fsoCreateFolder();
Read more detail in:
QlikView\Documentation\QlikView Reference Manual.pdf
:Book II
:28 VBSCRIPT FUNCTION CALLS FROM SCRIPT
page 855
Thanks.
The function below (and the call) are actually working.
Thanks,
Aldo.
Function fsoCreateFolder(FolderPath, FolderName) '(FolderName, FolderPath)
'Function Tested!
'Call the function as below:
'load fsoCreateFolder('$(vRootDir)', 'Created Folder No 1') autogenerate 1;
Dim objFSO
Dim objFolder
Dim Overwrite
Set objFSO = CreateObject("Scripting.FileSystemObject")
Overwrite = objFSO.FolderExists(FolderPath & "\" & FolderName)
Select Case Overwrite
Case False: Set objFolder = objFSO.CreateFolder(FolderPath & "\" & FolderName)
Case Else
End Select
Set objFSO = Nothing: Set objFolder = Nothing
End Function