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: 
Srpic
Contributor II
Contributor II

How to abort editing of excel (QMC)

Hi guys,

I've created a .qvw file that runs .vbs file, which runs macro-based excel file and everything works fine, when I run .qvw file locally. It runs the .vbs file and the macro in excel file as well.

However, when I set a task in QMC to the .qvw file and run the task, it seems to open the excel file, but that's it. It stucks in editing and I'm not able to remove / edit the excel file anymore.

 

 

Could you advise me how to abort the editing, please? I've already removed the task from server, but it didn't help. It still shows me that the file is locked for editing by 'sysBITechQvLdnDev', which is the Qlik server.

Srpic_0-1593593329423.png

 

Also, if you can advise me how to make QMC to run the .vbs file and then save excel file, properly, please?

Qlik code:

 

 

 

SET vCSCRIPT = 'c:\windows\system32\cscript.exe';

EXECUTE $(vCSCRIPT) "<PATH>\Refresh_TC_contacts.vbs";

 

 

 

VBS code:

 

 

Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Run "'<PATH>\TC contacts.xlsm'!Refresh.Refresh"
objExcel.DisplayAlerts = False
objExcel.Application.Quit
Set objExcel = Nothing

 

 

 

Macro code:

 

 

Sub Refresh()

    ActiveWorkbook.RefreshAll
    ActiveWorkbook.Save
       
End Sub

 

 

 

Many thanks!

 

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

The main difference between running tasks with QlikView Desktop and with QlikView Publisher is that the latter is not interactive. Any prompt or dialog that shows on the screen, such as the one you posted, cannot be "clicked" by the service. The task will be forever running until it is stopped in the QMC or the corresponding qvb.exe terminated in the Windows Task Monitor.

If that is not the case, you will need to explore how Excel works in that server so the file is always and only open as "Read Only" instead of "Write", and permissions in the operating system that may be blocking the execution of macros, such as antivirus software.

View solution in original post

1 Reply
Miguel_Angel_Baeyens

The main difference between running tasks with QlikView Desktop and with QlikView Publisher is that the latter is not interactive. Any prompt or dialog that shows on the screen, such as the one you posted, cannot be "clicked" by the service. The task will be forever running until it is stopped in the QMC or the corresponding qvb.exe terminated in the Windows Task Monitor.

If that is not the case, you will need to explore how Excel works in that server so the file is always and only open as "Read Only" instead of "Write", and permissions in the operating system that may be blocking the execution of macros, such as antivirus software.