Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everybody,
I have written the below VB Script(Macro ) to copy the value into clip board and while selecting more than one BA Names it will gi
I have also given a title for it. This is working fine in my machine.
But while accessing from access point I am getting the title as 'VB Script: Copy To Clipboard '
Script:
Sub Copy
SET fx = ActiveDocument.Fields("BA Name|BA ID|Accounting/Non Accounting")
SET fxV = fx.GetSelectedValues
if (fxV.Count) = 0 or (fxV.Count) > 1 then
'msgbox ("Please Select Only One Business Associate/Client")
strMessage = "Please select only one Business Associate/Client"
Msgbox strMessage, 0, "Copy To Clipboard"
else
ActiveDocument.GetSheetObject("LB136").CopyValuesToClipboard
end if
End Sub
Please advise
Thanks In Advance
Sonali
Have a look here: http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/28/macros-are-bad
- Marcus
My guess would be it's dependent on QV version, I get the "VBScript:" even when testing a local solution.
Maybe consider using native QV popup (ActiveDocument.ShowPopup) instead of msgbox, you'll be able to use a timeout as well. Much spiffier Although yeah, try to avoid macros, especially if you are targeting anything but desktop/plugin. Neither msgbox nor QV popup will work in webview.
I wish I still had the link, but I did some research on this a couple of years back. According to what I found there is no way to remove it and it is by design from Microsoft. It has something to differentiate it from standard system dialogs.”
Bill
What you CAN do is set up the error message as a text box and display it conditionally using a variable when needed.
For example, set up a variable called ShowError with a value of 1. Then create your error message in a text box (set the Layer on the Layout tab to highest possible value - 127?) and conditionally show (on Layout tab) ShowError=1. In the same text box set up an action (Add > External > Set Variable) which sets variable ShowError to 0. This will make your error message go away when clicking anywhere in the textbox.
Now in your VBScript, instead of invoking the MsgBox, set the variable to 1 to initiate your text box in the macro.
set v = ActiveDocument.GetVariable("ShowError")
v.SetContent "1",true
The only downside is you need to have the text box on every tab where it is needed, but it's just copy/paste.
flipside