Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Open an Excel workbook using Qlikview

Hi People,

I have found a few solutions on forum but nothing is working for me:

SET vQVFile = 'C:\Users\ljar01\Desktop\Klienci.xlsx';

sub ddd (Root)

set XLApp = CreateObject("Excel.Application");

set XLDOC = XLApp.Workbooks.Open($(vQVFile));

XLApp.Visible = True;

end sub

If there is sub ddd () without (root) there is an error:

"

Script line error:

sub ddd ()

"

I was also wondering if the reason lies in " ; " but it is not working whether these signs are in code or not.

My goal is to store database as csv and open it automatically via Qlikview to run a workbook macro.

How can i open Excel document via Qlikview?

Please help,

Best regards,

Jacek Antek

1 Solution

Accepted Solutions
zhadrakas
Specialist II
Specialist II

Hello,

one solution would be to create a Trigger "open URL" that opens

\\networkpath\Folder\Subfolder\InputData.xls

but thats probably not the best solution for your case.

Why dont you get your macro working in QlikView?

regards

tim

View solution in original post

14 Replies
zhadrakas
Specialist II
Specialist II

Hello,

one solution would be to create a Trigger "open URL" that opens

\\networkpath\Folder\Subfolder\InputData.xls

but thats probably not the best solution for your case.

Why dont you get your macro working in QlikView?

regards

tim

Anonymous
Not applicable
Author

Hi Tim Driller,

thank you for your tip but this CSV will be my database used in other Projects.

Unfortunately my company works mainly on Excel files so it has to be in that way...

Jacek

marcus_sommer

Where do you write this code - within the macro-editor? If you used there the following:

sub ddd

dim vQVFile

vQVFile = "C:\Users\ljar01\Desktop\Klienci.xlsx"

set XLApp = CreateObject("Excel.Application")

set XLDOC = XLApp.Workbooks.Open(vQVFile)

XLApp.Visible = True

end sub

it should work.

- Marcus

Anonymous
Not applicable
Author

Marcus,

it is working ! I was writing this in script code.

Hmm sa now should i call somehow this macro to run it via load script ?

Jacek

marcus_sommer

During the load-run you couldn't execute a sub-routine only macro-functions. I'm not sure if this kind of macro would work within a function triggered from load because statements which need an ActiveDocument won't work - by statements which need ActiveX I don't know.

As alternatively you could use an EXECUTE statement like: Re: Execute statement problem.

- Marcus

Anonymous
Not applicable
Author

Wow,

this is difficult.

I am trying to do something like this:

Execute start "" "C:\Users\ljar01\Desktop\Klienci.xlsx"

but this is not working...

Jacek

Anonymous
Not applicable
Author

hmm thisi is working:

EXECUTE C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE C:\Users\ljar01\Desktop\Klienci.xlsx;

but i am wondering if is possible to close alse this document and

if is possible to shorten "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" this one.

For example EXECUTE cmd.exe start excel.exe...

Jacek Antek

marcus_sommer

You could put the path to the exe and to the file into variables and call them within the EXECUTE statement. But I think I would rather use the above mentioned way to call a vbs-batch which opened and closed the xls and does maybe some other things than calling the xls directly - like in this example: Re: Run Excel from QMC.

- Marcus

Anonymous
Not applicable
Author

I will try this !

Thank You very much Marcus!

Warm Regards,

Jacek