Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro runs but doesn't create file for regular users

I have a macro which exports a chart to a csv file, then displays a completion text box to the user.

Our users are running the macro via Access Point using the IE Plugin.

The macro works fine and creates the file for 2 users (QV developers) but not for anyone else. The macro runs for them and displays the completion text box, but no file is created.

I have confirmed that they have set macro security to provide system access. Is there some particular permission required, or log file that might shed light on the problem?

The script is as follows.

sub ExportUpdates

  'create timestamp based name - specific to the second

  sUserName = Replace(ActiveDocument.GetLayout.AuthenticatedUser, "\", "_")

  sFileNameTS = CStr(year(now())) & right("0" & CStr(month(now())), 2) & right("0" & CStr(Day(now())), 2) & right("0" & CStr(Hour(now())), 2)

  sFileNameTS = sFileNameTS & right("0" & CStr(Minute(now())), 2) & right("0" & CStr(Second(now())), 2)

  sFileName = "\\sydinfil02\Common\Administration\Monthly Sales\QV\Clinician_" & sFileNameTS & "." & sUserName & ".csv"

  sFileName1= "\\sydinfil02\Common\Administration\Monthly Sales\QV\Clinic_" & sFileNameTS & "." & sUserName & ".csv"

  BudgetFileExtracted=false

  set sExportTable1 = ActiveDocument.GetSheetObject( "CH70" ) ' the main chart per clinician

  'Only export if there are rows to modify

  If sExportTable1.GetRowCount > 1 Then

  sExportTable1.Export sFileName,"|"

  sMessage = "Your updates were submitted."

  End If

  set sExportTable1 = ActiveDocument.GetSheetObject( "CH68" ) ' the chart per clinic

  'Only export if there are rows to modify

  If sExportTable1.GetRowCount > 1 Then

  sExportTable1.Export sFileName1,"|"

  sMessage = "Your updates were submitted."

  End If

  'Set variables to display text box

  set v = ActiveDocument.Variables("strFilename")

  v.SetContent sMessage,true

  set v = ActiveDocument.Variables("bDisplayFilename")

  v.SetContent "1",true

end sub

Regards,

Derek

0 Replies