Hi All,
Could anyone help me with this code please. Im not sure what im doing wrong here. But what im trying to do is to open a ppt file based on the name of the file. Basically "dept" in the below code is a variable where in the name can be any thing. The challenge is using a wild card. For example if the name of the file i want to search and open is " John Smith" and there are many files with the last name as Smith, i need to check for either John or Smith to be available in the file name and then if there is a match then open that file. Guess this would need a wildcard character, but im unable to crack it. Here is the code line where im stuck
Set desppt = newPowerPoint.Presentations.Open(Filename:="C:Documents and Settings" & Environ("username") & "My DocumentsEP - " & dept & Format(Range("A1"), "mm dd yy") & ".pptx", withwindow:=msoTrue)
Hope my question is clear. Please do let me know.
Thanks a ton!
Regards
Sam
Could anyone help me with this code please. Im not sure what im doing wrong here. But what im trying to do is to open a ppt file based on the name of the file. Basically "dept" in the below code is a variable where in the name can be any thing. The challenge is using a wild card. For example if the name of the file i want to search and open is " John Smith" and there are many files with the last name as Smith, i need to check for either John or Smith to be available in the file name and then if there is a match then open that file. Guess this would need a wildcard character, but im unable to crack it. Here is the code line where im stuck
Set desppt = newPowerPoint.Presentations.Open(Filename:="C:Documents and Settings" & Environ("username") & "My DocumentsEP - " & dept & Format(Range("A1"), "mm dd yy") & ".pptx", withwindow:=msoTrue)
Hope my question is clear. Please do let me know.
Thanks a ton!
Regards
Sam