Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sunny_talwar

Browsing for a folder Macro

Hi Qlikers

I have yet another question. Using the application posted on here -> Re: How to browse a folder and get file using external macro in qlikview? I have gotten to a point where I can let the user browse for a file and then do a partial reload to load additional data. I only have two issues:

  • If I press on Browse and click Cancel for some reason it takes me to the Edit Module window. I don't want that to happen for the user. If the press cancel, they go back to the original screen where they can make changes. Is there a way to achieve this?
  • Second issue is related to module security access. This particular macro requires system access, but user may or may not have already assigned that access, is there a more efficient way (beside Ctrl + Shift + M) to achieve this? (May be like a button??) (I have asked this question here -> Button for QlikView Shortcuts?)

Any help on this would be greatly appreciated

Best,

Sunny

1 Reply
sunny_talwar
Author

If anybody is curious, I was able to resolve the first issue where the edit module was showing up by changing the script for the macro slightly.

Sub BrowseFolder

  Const OverWrite = True

  Dim destpath,  srcFiles

    Set objShell = CreateObject("Shell.Application")

    Set objFolder = objShell.BrowseForFolder(0, "Example", 16384,"Computer")

        On Error Resume Next

          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 " Path: " & objFolder.self.path

End Sub


Still need help with the first issue.

Best,

Sunny