Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

VB macro in QlikView - import VB packages

Hi all,

I need to find out the working directory from which my QlikView VB macro is running.

According to MSDN, this should suffice:

Imports System

Imports System.IO

Dim path As String = Directory.GetCurrentDirectory()

The thing is that QV doesn't recognize the Imports or Directory.

Any clue how to import VB packages in QlikView? I'm sure there are also other cases where it can be useful.

Thanks,

Assaf

1 Solution

Accepted Solutions
jerrysvensson
Partner - Specialist II
Partner - Specialist II

That is VB .Net not vbscript.

vbscript is what is used in QlikView.

Try to google: vbscript current directory

View solution in original post

3 Replies
rubenmarin

Hi Assaf, so far I know there is no 'Imports' Statement in vbscript, 'Imports' is a Visual Basic statement.

Not sure if the CreateObject statement can help you, for a qlikview macro you need to search for vbscript (or JScript)

jerrysvensson
Partner - Specialist II
Partner - Specialist II

That is VB .Net not vbscript.

vbscript is what is used in QlikView.

Try to google: vbscript current directory

Anonymous
Not applicable
Author

Thanks Jerry, your reply put me on the right tracks.

This is the answer:


Dim WshShell, strCurDir
Set WshShell = CreateObject("WScript.Shell")
strCurDir 
= WshShell.CurrentDirectory