Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

BrowseForFolder to select a file doesn't work.

Hallo,

I need a script to select a FIle ( not a directory ).

If I use BrowseForFolder with the option to consider files too, it works for folder, and it displays files.

But it doesn't work if I select a file.

How can I select a file browsing for file system ?

This is the script I found searching in qlikview forum that doesn't work for file.

' SCRIPT TO BROWSE THE FOLDER AND SELECT THE FILE NAME
Sub BrowseFolder
Const OverWrite = True
Dim destpath,  srcFiles, vpfname
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.BrowseForFolder(0, "Select File", 16384,"Computer")
    If  objFolder Is Nothing Then
        Wscript.Quit
    End If
    ActiveDocument.Variables("vFileName").SetContent objFolder.title, true
    ActiveDocument.Variables("vFolderName").SetContent objFolder.self.path, true   
    MsgBox "folder: " & objFolder.title & " Path: " & objFolder.self.path
    ActiveDocument.Fields("FILENAME").Select objFolder.title  
End Sub 

Can you help me ?

Thank you.

2 Replies
Anonymous
Not applicable
Author

Hi,

Can you ellaborate a little bit on what you're trying to achieve?

What would you like to do with a file that you select?

How do you know what file you want to select, etc.?

Not applicable
Author

I want to open another qlikview document directly from main document user opens. I want user browses from file system to find the '.qvd' document he wants to open.