M md Mar 29, 2008 #1 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
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
M md Mar 29, 2008 #2 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 Click to expand... ActiveWorkbook.Path + '\' + ActiveWorkbook.Name (that was easy)
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 Click to expand... ActiveWorkbook.Path + '\' + ActiveWorkbook.Name (that was easy)
B Barb Reinhardt Mar 29, 2008 #3 You may want to consider using ThisWorkbook if the workbook with the macro is not the active workbook.
You may want to consider using ThisWorkbook if the workbook with the macro is not the active workbook.
D Dave Peterson Mar 29, 2008 #4 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
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