File name and path of current workbook
February 15, 2008
I’ve found this useful when working on files on a department shared drive. I link it to a custom button on my toolbar, so I can just click the button and copy the full filename to the clipboard.
Sub copyFilePath()
‘ Sub copyFilePath
‘ Author: Brent Harvey
‘ Email: Excel.Examples@brentharvey.net
‘ Date: 02/20/2007
‘ Source:
‘ http://www.cpearson.com/excel/clipboar.htm
‘ Copies path and file name of active workbook to clipboard
‘Requires Microsoft Forms 2.0 Object Library
‘Click on Tools, References and tick Microsoft Forms 2.0 Object LibraryDim MyDataObj As New DataObject
MyDataObj.SetText ActiveWorkbook.Path & “\” & ActiveWorkbook.Name
MyDataObj.PutInClipboard
End Sub
Posted in
content rss
