Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the below macro code to create a project folder in server, if it already does not exist, run by a button object on access point.
vSelectedProjName - is a qlikview variable that holds the selected project name.
Sub CreateFolder
dim filesys, vFolderPath1, vFolderPath2,vFolderPath,NewProjectFolder
set vFolderName = ActiveDocument.GetVariable("vSelectedProjName")
vFolderPath1 = "D:\"
vFolderPath2 = vFolderName.GetContent.String
vFolderPath = vFolderPath1&vFolderPath2
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(vFolderPath) Then
Set NewProjectFolder = filesys.CreateFolder(vFolderPath)
End If
End sub
This code was adapted from Create a folder in system by using macro code link.
I selected a project name and clicked the create folder button. It works correctly in desktop version and when the application is opened via access point on Chrome browser - i.e creates the required folder in server
However, it does NOT work with IE Plugin. i.e it creates the folder in my local system, instead of creating it on the server.
NOTE: I have already ensured the below:
1) Gave macro system access by clicking ctrl +shift +M
2) In Qlikview desktop->User preferences->Security -> Module (allow create object and file access) is checked.
3) In internet options, i have enabled the settings for ActiveX control.
Please let me know if i am missing any other setting.
Qlikview version: 11.20 SR13 and the corresponding IE plugin version was installed.
If you are using the IE Plugin as an AccessPoint client, macros will be executed in the client. And the client runs entirely on your desktop/laptop.
Try the following by specifying the drive:
vFolderPath1 = "\\YourServer\D\"
- Marcus
To use Marcus example, make sure that your server location is shared to the end-users and the share is called 'D'.
There is an even simpler UNC path that you could use:
vFolderPath2 = '\\YourServer\D$\';
but for that to work, you need to have Administrator access to the server. Which may not be something you would like to do for QlikView users...
Hi Marcus, thanks for your input. I tried your solution - by passing the address as \\<Server IP address>\D:
But it still did not work. It continued to create a folder in my desktop.
Please let me know if there is any other work around for this
Hi Peter, thanks for your inputs. When i used the path as \\<Server IP address>\D$, it actually threw an error.
There was no error when I passed it as \\<Server IP address>\D: however, the folder was still created in my desktop.
Please let me know if there is any other work around for this.
My suggestion had worked to create or change files on the server and therefore I see no reason why creating folders shouldn't work. At first make sure that you have the proper access rights to the server-drive and enter on your local machine: \\YourServer\D$\ within the windows-explorer - if this don't work you need to adjust the access rights.
- Marcus
Hi Marcus,
It does look like access issue then. The bank security rules are quite strict.So, I think we will not be able to allowed to access it this way.
I have a ServerSideExport macro in the same application that exports file from access point into the server, and this works perfectly fine even on IE plugin and writes the file on the server, where the path is only given as "D:\Foldername"
Likewise, is there any other qlik server side API that can be used to move files in this case? or any other way to achieve the moving of files from one folder to another via a button on access point?
This could be possible. With Using EDX in QlikView 11 - basic example could qmc-tasks in general be triggerred and per an EXECUTE statement within them you could execute directly batch-statements or external batch-files which do your wanted filesystem-operations.
- Marcus