HI,
I want to update below code to openable file from listbox,
i want to open selected file using commandbutton1
For userform code
in module![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
HI,
I want to update below code to openable file from listbox,
i want to open selected file using commandbutton1
For userform code
in module![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Use Code-Tags for showing your code :
Please mark your question Solved if there has been offered a solution that works fine for you
If You like solutions provided by anyone, feel free to add reputation using STAR *
Above code populating a listbox with files from director
To open, give the button this code:
![]()
Please Login or Register to view this content.
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know
There are 10 kinds of people in this world... those who understand binary, and those who don't.
@ Arkadi,
O.K. I have not looked at the sample Workbook provided yet, 'cause I'm lazy, and it your job in any case!
Please clean clean your glasses, shake your head so the your ears can give you a wake-up beating, and look at you Code again!
It will only open the Workbook named Jan 2 Dec 2014\1.12.16, ignoring any other selection from the ListBox.
Am I correct, or am I correct?
How about:
Regards.![]()
Please Login or Register to view this content.
Please consider:
Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
Hmmm Winon,
I'm confused this time...
His findfiles function searches files in the folder "Z:\42766\Jan 2 Dec 2014\1.12.16\" does it not? The listbox has the filename but not the path...which is the full string...
Why would my code ignore the listbox part in the open command?
It is not that I am trying to say I'm right, I just fail to see the flaw in my post? Explain it to me like I'm an idiot (maybe I am, lol)
When I create the exact same folder structure on my C drive and change the code to C: it works here
Hi Arkadi,
Defeat (but not the hands) admitted!O.K. I have not looked at the sample Workbook provided yet, 'cause I'm lazy, and it your job in any case!![]()
I turn out to be the idiot here, for not checking the sample Workbook first.
I would appreciate it if you would stop getting "upset" with me, when I ruffle your feathers, though!LOL
Take care my Friend.
Thanx all of you , dear Guru ji and Expert ji
This is my path
in above path i have more then one folder, now i have 3 folders in above path![]()
Please Login or Register to view this content.
first folder
second folder![]()
Please Login or Register to view this content.
third folder![]()
Please Login or Register to view this content.
and all file from above folder are populatting in my listbox![]()
Please Login or Register to view this content.
now
i am trying to open files using command button
as you provided code to open the files @Arakdi
Workbooks.Open ("Z:\42766\Jan 2 Dec 2014\1.12.16\" & ListBox1.Value) = this opening only files from the first folder as i mentioned folders above
if i change the path
Workbooks.Open ("Z:\42766\Jan 2 Dec 2014\1.12.16\1.12.16\" & ListBox1.Value) = this is opening only second folders file
if i change again the path
Workbooks.Open ("Z:\42766\Jan 2 Dec 2014\1.12.16\1.1.17\" & ListBox1.Value) = this one is opening only the third folders file
and Guru ji
Workbooks.Open ("Z:\42766\" & ListBox1.Value) this path have no files
because above code will open only folders files as we give the path not opening from folders and subfolders
so need another solution please
btw
thanx again for the reply
Hello Sid,
Have you seen my Post in your other Thread?: http://www.excelforum.com/showthread.php?t=1172305
Would that approach not suit you better?
Regards.
Last edited by Winon; 02-04-2017 at 02:55 AM. Reason: Atttached sample file for clarification.
Dear, sir Winon
i want to populate listbox with my files,
while you sample file (Hyperlink Directory Contents.xls) is awesome. but here is the condition is different so i have to user listbox to populate the list of files so i can't use this file in above condition
please do something about above code
and
thanx again![]()
Here you go.
Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.
Hello, bakerman2
working perfectly
thanx a lot all of you
thread closed
You're welcome and thanks for adding rep points.![]()
@Winon I hope I did not seem upset and you were just joking my friend... I took no offense at all![]()
@ Arkadi,
Not at all my friend.It is just my bad habit of jerking chains!
All is good!
Take care,
Kind Regards.
Hello Sid,
bakerman2 was faster than me, but here is my proposed solution as well.
Thank you for the Rep points, I really appreciate it!![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks