VBA Get File Name
Solved
pampiou
Posted messages
24
Status
Membre
-
gogodu75 -
gogodu75 -
Hello programming experts!
I'm currently working on a program in Visual Basic with Excel. I would like to automatically retrieve the file name and store it in a variable so as to avoid changing all the lines of code where the file name is referenced.
So far, I've done this:
Dim name As String
name = Workbooks.Application.Name
But the problem is that the variable "name" returns "Microsoft Excel".
If any of you have a solution to retrieve the file name (without the path), I'm all ears!!!
Thanks in advance for your help.
I'm currently working on a program in Visual Basic with Excel. I would like to automatically retrieve the file name and store it in a variable so as to avoid changing all the lines of code where the file name is referenced.
So far, I've done this:
Dim name As String
name = Workbooks.Application.Name
But the problem is that the variable "name" returns "Microsoft Excel".
If any of you have a solution to retrieve the file name (without the path), I'm all ears!!!
Thanks in advance for your help.
There wasn't much to find, but after a good hour of searching without finding anything, you saved me :p