Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Check file exist via macro

Hi all,

I am new in Qlikview and facing a problem in check file exist.

I have create a macro to check if file exist. and don't know how to call it out in script.

I want to do

if the xxx.qvd exist then do some incremental loading, if not exist will load all of record from an xls.

Here is my macro function:

Function CheckFileExist(filename)

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Dim result

   

    If objFSO.FileExists(filename) Then

        result = 1

        msgbox ("good")

    Else

        result = 0

        msgbox ("not good la ...")

   

    End If

    CheckFileExist = result

End Function

Please help ...

or if any other way to do so ?

Thanks~

Tags (3)
1 Solution

Accepted Solutions
Partner
Partner

Check file exist via macro

Hi, in the Script, you can use the filetime() function to check if a file exists.

For example:

if isnull(filetime('c:\file.txt')) then

//file doesnt exists

else

//file exists

end if

Hope this helps you.

Regards,

Fernando

View solution in original post

2 Replies
Partner
Partner

Check file exist via macro

Hi, in the Script, you can use the filetime() function to check if a file exists.

For example:

if isnull(filetime('c:\file.txt')) then

//file doesnt exists

else

//file exists

end if

Hope this helps you.

Regards,

Fernando

View solution in original post

Not applicable

Check file exist via macro

Hey Fernando,

Thanks for you help...filetime() works ..