Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bluecarbon
Partner - Creator
Partner - Creator

vb Macro to browse QVW or QVD files

Hi All,

The below code works fine all type of files other than QVW, QVD and CSV.

     Is it not possible to copy a QVW file from one location to another location using vb scripts?

Sub File_Browser()

Dim objShell

Dim strFileName

Dim strFilePath

Dim objFile

Set objShell = CreateObject("Shell.Application")

Set objFile = objShell.BrowseForFolder(0, "Choose a file:", 16384)

strFileName = objFile.Title

strFilePath = objFile.self.Path

MsgBox "Just the file name: " & strFileName & vbCrLf & "The full path: " & strFilePath

Set objFileName = Nothing

Set objFilePath = Nothing

Set objShell = Nothing

End Sub

Thanks,

Rakul.

3 Replies
marcus_sommer

You could use code like this:

dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile SoureFileWithFullPath, TargetFileWithFullPath
Set objFSO = Nothing 

- Marcus

bluecarbon
Partner - Creator
Partner - Creator
Author

Marcus,

Thanks for writing back. Please let me know is there any way I can invoke File Browser dialog box inside Qlikview VB script, through which any other Qlikview file can be selected dynamically.

Thanks,

Rakul.

marcus_sommer

You might need another parameter in BrowseForFolder, like:

Set objFile = objShell.BrowseForFolder(0, "Choose a file:", &H4000)

See also: Using the Browse For Folder Dialog Box. Alternative would be this here: VBScript Scripting Techniques: File Open Dialog.

- Marcus