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

Copy to clipboard (excel macro) not functioning after upgrade to Publisher

Hi,

After updating the server with a Publisher license and moving all Excel generating tasks from Windows Task Scheduler to Supporting Tasks in QMC the export is failing due to the fact that the clipboard is not functioning.

For example, if I copy text 'abc' in notepad, later, when the Excel files are generated, they will contain only the 'abc' string. It`s like the QMC does not have permissions to clear and populate the clipboard.

Any ideas?

16 Replies
peterwh
Creator II
Creator II

Hello,

if you use publisher you can't use "ActiveDocument" and so on in QV-macro, since it is a batch job. If you want to use your functionality through Publisher, you have to use "supporting Tasks" -> External Programs. There you can call every program, even the "normal" qv.exe.

Try something like this as commandline:
"C:\Program Files\QlikView\Qv.exe" /r "<PathToDashboard>\<DashboardName>.qvw"

If you are using QV12.20 SR7 and smaller, you have to add "/nodata" as parameter, due to a bug.

Kind regards
Peter

avantime
Creator II
Creator II
Author

Hi,

I am using External programs also, with the same command line.
The macro consists of 2 parts, one that generates the excel and one that sends the email. I receive the email, but the excel file contains the old clipboard text as shown in the initial post.
peterwh
Creator II
Creator II

Sorry, I didn't read that you are already using supporting tasks.

Which version of QV do you use?

Could you post your Macro-code?

avantime
Creator II
Creator II
Author

I'm on the phone right now and don't have access to the macro, but i can assure you it's not the cause. The macro works ok when opened in Desktop or via Task scheduler.
marcus_sommer

The cause might be the (service) user with which the publisher runs. I don't know if there are ways within the publisher to specify the user of such task - if not you could try to apply a RUNAS within the comandline or through an intermediate batch-file. Another possibility might be just to start the windows-task like:

schtasks.exe /Run /TN "QlikView Tasks\ExportAndPrint";

- Marcus

peterwh
Creator II
Creator II

Hello,

Marcus, this is a good point. I didn't consider the problem could be the user.
I don't know a possibilty in publisher to specify a user. So we are testing everything with the service user.

- Maybe the service user isn't allowed to run Excel?
- Maybe the service user has no rights to write the Excel-File?
- Did you test your macro with the service user?

Peter

avantime
Creator II
Creator II
Author

I thought about user permissions but I don`t think that is the case.

Excel runs ok, as I said in the first post, the problem is with the copy / paste command from qlikview to excel.

marcus_sommer

At first I would re-start the whole machine to exclude that any weird things cause this issue. If this doesn't help you could follow one of the various hints in this and within the linked postings, like clearing the clipboard before using it:

copy-to-clipboard-failed

- Marcus

avantime
Creator II
Creator II
Author

Already did that, also cleared the clipboard ahead by 

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "cmd.exe /c echo. >NUL | clip", 0, True

I repeat, everything runs perfect outside Publisher. This has been a real headscratcher for me.