Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

open excel file in qlikview using macros

Hi,

This is a script am using to open excel file within application but it is not working please help to solve this

Sub Close()

set XLApp = CreateObject("Excel.Application")

fname="D:\Jeld-wen-new-requirements\Excels\ZSD008OA.xlsx"

set XLDOC = XLApp.Workbooks.Open(fname)

XLApp.Visible = True

end sub

8 Replies
vikasmahajan

Check with this settings

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Anonymous
Not applicable
Author

Instead of path i can use a variable?

vikasmahajan

yes defile in script

SET vQVFile = 'D:\Jeld-wen-new-requirements\Excels\ZSD008OA.xlsx';

Sub Close()

set XLApp = CreateObject("Excel.Application")

set XLDOC = XLApp.Workbooks.Open($(fname))

XLApp.Visible = True

end sub

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
vikasmahajan

instead of fname use vQVFile

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Anonymous
Not applicable
Author

i just have file name in the variable not entire path

Anonymous
Not applicable
Author

I need to use variable in that file name is stored path is same for all file name changes according to the client selection

Sub Close()

set XLApp = CreateObject("Excel.Application")

fname="D:\Jeld-wen-new-requirements\Excels\$(Variable)"

set XLDOC = XLApp.Workbooks.Open(fname)

XLApp.Visible = True

end sub

vikasmahajan

Better you take file name in input box assign this to variable and use this variable in macro.

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Anonymous
Not applicable
Author

Thank you..