Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have app with simple Macro to Allow user to enter details.I published the app to users .It is working for some people but not all.The input box is not getting activated for some users.I tried on Server/IE it worked for me.Is CAL type has something to do with macro not working.Need help.
sub EnterDetails
EnterDetails_Text = Application.InputBoxEx("Type Details:",ActiveDocument.Variables("EnterDetails").getcontent.string)
set v=ActiveDocument.Variables("EnterDetails") |
v.SetContent EnterDetails_Text,TRUE
Thanks in advance
Finally it worked .Some users are using AJAX (Not aware of IE plugin) and some did not allowed macros first time they opened application. Thanks Marcus_Sommer
More likely is that some users have disabled the macro-execution. You could check this within the setting.ini in the user-folder from each user or you checked it with the shortcut: ctrl+shift+m.
- Marcus
Thanks for reply Marcus_Sommer Little Confused.App is avaiable in Access Point.I checked with users they did not saw any allow safe macros message for the first when they opened the app.So where exactly I need to check it ? Is it in server folder?
Hi chaiperi,
Make sure users have the option "Give System Access to module script" checked
Users can do this by pressing ctrl+shift+m when you open the application.
Also, under Edit Module where you created the macro, under "Requested Module Security" select "System Access" and under "Current Local Security" select Allow System Access.
Macro-execution need to be enabled form each single user and probably was very fast clicked within the small msgbox and then forgotten. Server settings shouldn't be involved because by some user it worked and those settings are global.
If the macro only contained what you have posted then there isn't an issue with the modul-rights - system access will be needed if you want to execute ActiveX or read and write something within the filesystem and so on.
- Marcus
Macro is to write some details back to SQL database.EnterDetails Button has three Actions
1.Set EnterDetails to Null to clear previously entered Detail
2.Run Macro to activate InputBox to enter detail which will be assigned to vEnterDetail variable
3.Run Macro to Write Back variable value to respective field in SQL Database table.
If you writeback into a database then I think you will need to allow system-access. But before looking everywhere comment these routines out and put a simple msgbox into to see if the macro-execution worked.
- Marcus
I tested the macro it worked and able to write back to database
Macro used
sub EnterDetails
EnterDetails_Text = Application.InputBoxEx("Type Details:",ActiveDocument.Variables("EnterDetails").getcontent.string)
set v=ActiveDocument.Variables("EnterDetails")
v.SetContent EnterDetails_Text,TRUE
end sub
'SQL WriteBack Macro
sub WriteBackDim strDetail
Dim strID
Dim strUser
Dim strvalue
strComment = ActiveDocument.Variables("EnterDetail").GetContent().String
strReportDate = ActiveDocument.Variables("vTransactionDate").GetContent().String
strOSUser = ActiveDocument.Variables("vOSUser").GetContent().String
strValue= ActiveDocument.Variables("vvalue").GetContent().String
x=msgbox("Confirm Detail:" & strDetail ,3, "Confirm Detail")
'if msgbox("Confirm Detail:" & strDetail ,3, "Confirm Detail",vbYesNo)=vbNo
if x=vbNo or x=vbCancel then
msgbox("Detail not Entered")
exit sub
end if
Set com = CreateObject("ADODB.Connection")
com.open "Provider=SQLOLEDB;Data Source=ABC;Database=XYZ;User Id=ID;Password=PW;"
sql="INSERT INTO [tblDetails](lookup, Detail, TransactionDate, enteredBy)VALUES ('" & strValue &"', '" & strDetail & "', '" & strTransactionDate & "', '" & strOSUser & "')"
on error resume next
com.Execute sql
if err <> 0 then
msgbox("No Luck" & err )
else
msgbox("Succesfully Entered Details")
end if
com.close
end sub
If it's worked for some user and for some not is the reason definitely the settings within the user-properties and also the rights for accessing the database and maybe some further security topics like blocked ports or group policies and similar.
- Marcus
Hi,chaiperi.
Verify if isn't marked checkbox Allow unsafe macro execution on server. The way in Qlikview Server is:
Make test marking it.
Hope this helps.