Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm having a problem with different behaviour in debug mode, compared to test mode in a VBScript module.
When the user logs in, I have a couple of triggers that check the username, and then decide on the basis of some settings in a 'security' table whether or not a particular sheet should be visible.
There are variables for each sheet v(sheetname)Visible v(sheetname)Sample that get set and the sheets are set up to show conditionally based on the values in the variables.
When the code runs on start up, it is not correctly setting one of the variables. If I go into the module editor and run the checkVisibleSheet macro in test mode, it also sets the variable incorrectly. However, if I set a break point and step through the variable setting routine manually in debug mode, it works correctly!
Any clues - I'm tearing my hair out!!!
Maybe it's timeing issue... Try to insert this line before/after setting the variable:
ActiveDocument.GetApplication.WaitForIdle
Thanks for the suggestion - it does look like something like that. However, sprinkling those around doesn't seem to make a difference, but I will persevere!
You can also try "sleep":
ActiveDocument.GetApplication.Sleep 1000 ' 1 second
Thanks - I have tried some minor recoding and the initial problem seems to have gone away, so I'm keeping everything crossed....
Also, keep in mind that certain QlikView APIs are not available when the macro is running "OnOpen"...
Just a note that the .waitforidle script items caused a lot of probems with the Ajax version, although this was not obvious running from the client.