Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ReloadTime

Hi,

I'm struggling trying to figure out the problem with this vbscript -

Sub ReloadOnOpen

  if (Date() > ReloadTime()) Then

      ActiveDocument.Reload 

    end if

End Sub

I get the error message - "Type mismatch: 'ReloadTime'.  I've seen other posts where the ReloadTime function has been used and so it ought to work.  Am relatively new to qlik and would appreciate any suggestions?

Thank you.

1 Solution

Accepted Solutions
marcus_sommer

Reloadtime() isn't a valid vbs-function - you need to adjust to this example from the APIGuide.qvw:

set docprop = ActiveDocument.GetProperties

msgbox docprop.UtcLastReloadTime

- Marcus

View solution in original post

5 Replies
marcus_sommer

Reloadtime() isn't a valid vbs-function - you need to adjust to this example from the APIGuide.qvw:

set docprop = ActiveDocument.GetProperties

msgbox docprop.UtcLastReloadTime

- Marcus

tamilarasu
Champion
Champion

Hi Venkatesh,

I have not tested the below code but hope this will work.

Sub Test

ReloadDate = ActiveDocument.Evaluate("Date(ReloadTime(),'DD/MM/YYYY')")

Today = ActiveDocument.Evaluate("Date(Today(),'DD/MM/YYYY')")

If Today > ReloadDate Then

ActiveDocument.Reload

Else

Msgbox "Application has already been reloaded for today!"

End If

End Sub

Not applicable
Author

Hi Marcus, Tamil,

Thank you very much!  That worked.

Regards,

Venkatesh

tamilarasu
Champion
Champion

Please close the thread by marking correct/helpful replies. So that it might helps others in future.

Not applicable
Author

Actually, both worked.  Greatly appreciate the help.