How to open a file by choosing its name from a combobox?

Abo Rawad

New Member
Joined
Jan 23, 2012
Messages
8
How to open or Print a doc or pdf file from a combobox on a userForm

I have a folder full of doc files. I used a userform on which i put a combobox which contains those files' names and a cmd to open the file.

I managed to copy all the files names to the WorkSheet and listed them in the combobox.

@@@ I need a VBA code to do the following :

1- looking for the file name which matches the one i choose from the combobox
2- if there is a match, show " match" on a lable.
3- when i click the "open" cmd i created on the userform, it opens the file. or even print it and close it
4- prepare for another match.

I know it a lot of work and i am not that good in VBA, but THANKS in Advance

### ###​
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,215,771
Messages
6,126,799
Members
449,337
Latest member
BBV123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top