Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba, get filename of this workbook
I running a vba script inside a workbook. How do I get the complete
path to the workbook and name in which this script runs? Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba, get filename of this workbook
On Mar 28, 8:46 pm, md wrote:
I running a vba script inside a workbook. How do I get the complete path to the workbook and name in which this script runs? Thanks ActiveWorkbook.Path + '\' + ActiveWorkbook.Name (that was easy) |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba, get filename of this workbook
You may want to consider using ThisWorkbook if the workbook with the macro is
not the active workbook. -- HTH, Barb Reinhardt "md" wrote: On Mar 28, 8:46 pm, md wrote: I running a vba script inside a workbook. How do I get the complete path to the workbook and name in which this script runs? Thanks ActiveWorkbook.Path + '\' + ActiveWorkbook.Name (that was easy) |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba, get filename of this workbook
And you may want to use & instead of +.
+'s are used to add numbers. &'s are used to concatenate strings. But excel's VBA is forgiving. ActiveWorkbook.Path & "\" & ActiveWorkbook.Name or even: Activeworkbook.fullname or ThisWorkbook.fullname md wrote: On Mar 28, 8:46 pm, md wrote: I running a vba script inside a workbook. How do I get the complete path to the workbook and name in which this script runs? Thanks ActiveWorkbook.Path + '\' + ActiveWorkbook.Name (that was easy) -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Workbook name in VBA doesn't match filename.xls | Excel Discussion (Misc queries) | |||
Saving XLS workbook with set filename | Excel Discussion (Misc queries) | |||
link to other workbook with changing filename | Excel Worksheet Functions | |||
Filename in footer automatically in new workbook. | Excel Discussion (Misc queries) | |||
How do I remove multiple windows of 1 workbook (filename.xls:2,:3 | Excel Discussion (Misc queries) |