Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In a qvw one field I have is [File]. This includes filenames like "ABC.xlsm" and "ABC 2.xlsm". I have a button on my qvw to open the file indicated by your selections (the button has an enable condition so that it is only actionable when there is a single file based on your selections). All the files are Excel files, and I want the button to open them as read-only.
I thought I had this solved: I was using the following settings for the button action:
Action: Launch
Application: EXCEL.EXE
Filename: =' /r \\server\folder\' & Only(File)
... where \\server\folder\ is obviously the file location, and Only(File) returns the filename. The /r bit specifies read-only. The settings are shown in the picture below.
BUT I have just realised the button isn't working as intended where there is a space in the filename. So it works for "ABC.xlsm" but not for "ABC 2.xlsm". With "ABC 2.xlsm", it tries to open 2 files in Excel, "ABC" and "2": i.e. it treats the space in the filename as some sort of list delimiter.
Does anybody have any suggestions? I have already tried a few things, none with any success:
Unfortunately changing the filenames to exclude spaces is not an option.
Your help is much appreciated!
Thanks,
Sarah
Hi sarahallen,
In the application box I also placed EXCEL.EXE
In the filename box I placed something like to quickly try it:
"C:\Documents and Settings\User\Dashboard Example.xlsx"
I also tried the option with variable path name. For this I created three variables:
vPath = \\server\folder
vFile = File.xlsx
vPathFile = = '"' & vPath &vFile &'"'
In the filename box of the button I then placed the following text
= vPathFile
Attached the quickly created version with above solution. Note the variable vPathFile is not really required but handy for traceability of what QlikView is doing.
Update 22-5:
I have also been able to pass through read only command, you need to place '/r' in the parameters input box. [Note: this command is not included in the attached qvw]
Kind regards,
Matthijs
Hi,
For me it worked to ensure that the filename with spaces is enclosed with double quotes (""). I did not try if it works with dynamic created filenames
Kind regards,
Matthijs
Thanks Matthijs. Could you please tell me exactly where you put the double quotes?
Did you have the /r parameter and EXCEL.EXE specified as the application?
Thanks for your help
Hi sarahallen,
In the application box I also placed EXCEL.EXE
In the filename box I placed something like to quickly try it:
"C:\Documents and Settings\User\Dashboard Example.xlsx"
I also tried the option with variable path name. For this I created three variables:
vPath = \\server\folder
vFile = File.xlsx
vPathFile = = '"' & vPath &vFile &'"'
In the filename box of the button I then placed the following text
= vPathFile
Attached the quickly created version with above solution. Note the variable vPathFile is not really required but handy for traceability of what QlikView is doing.
Update 22-5:
I have also been able to pass through read only command, you need to place '/r' in the parameters input box. [Note: this command is not included in the attached qvw]
Kind regards,
Matthijs
Hi Matthijs,
Sorry I took so long to get back to you. I've just tried out your solution (been a busy few months!!!) and it works really well (see settings below).
Thank you so much.
Kind regards,
Sarah