Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
skusuma1991
Creator
Creator

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
Champion
Champion

Check with this settings

Vikas

skusuma1991
Creator
Creator
Author

Instead of path i can use a variable?

vikasmahajan
Champion
Champion

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

vikasmahajan
Champion
Champion

instead of fname use vQVFile

skusuma1991
Creator
Creator
Author

i just have file name in the variable not entire path

skusuma1991
Creator
Creator
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
Champion
Champion

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

Vikas

skusuma1991
Creator
Creator
Author

Thank you..