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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bindu_apte
Creator III
Creator III

Browse file macro code

Hi,

When I searched for an sample to browse files from local machine to some path using qlikview macro.

But using that I can browse for only word or excel files, I wanted to upload jpeg or other image files.

Hence please let me know what changes I need to do in this code.

6 Replies
tamilarasu
Champion
Champion

Hi,

Try this code.

Sub BrowseFolder

Set oXL=CreateObject("Excel.Application")

File_Name=oXL.GetOpenFilename("All Files (*.*),*.*",,"Select file",False)

If File_Name = "False" then

Msgbox "Try Again"

Set oXL=nothing

Exit sub

End If

ActiveDocument.Variables("vFileName").SetContent File_Name, True

End Sub

bindu_apte
Creator III
Creator III
Author

Hi,

I tried this code but taking long time to browse and not able to copy files after browsing

tamilarasu
Champion
Champion

Hi,

I just showed the method to browse the image file and not to copy the file to some other locations. You can use existing subroutine (second one) in your attached example.

I have suggested the above method because there are multiple reasons.

You cannot use the attached file code for certain file types (DOC, TXT nd VBS ). I was not sure about the image files. I did a test and it's not working for image file as expected.

how to browse for a file in Windows 7 (x64) ? - VBScript - Tek-Tips

I found various methods to browse the files. But most of them are not elegant and not working in Windows 7.

tamilarasu
Champion
Champion

Bindu,

You can use the below attachment.

bindu_apte
Creator III
Creator III
Author

Hi Nagaraj,

Missed the attachment. Please share.

tamilarasu
Champion
Champion

Hi Bindu,

I have already attached the file. Please check the above reply.

Capture.PNG