Johnny C
Well-known Member
- Joined
- Nov 7, 2006
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
Just been away for a week. Until I went way this has worked for years. Now it's just returning 2 ASCII 63's. I checked, MS forms 2.0 and Microsoft Excel 15 Objects are both included in References, can anyone spot why it's not working? it's just an icon on the QAT which copies in the workbook refs and puts them into the clipboard so I can paste as text elsewhere.
TIA
Just been away for a week. Until I went way this has worked for years. Now it's just returning 2 ASCII 63's. I checked, MS forms 2.0 and Microsoft Excel 15 Objects are both included in References, can anyone spot why it's not working? it's just an icon on the QAT which copies in the workbook refs and puts them into the clipboard so I can paste as text elsewhere.
Code:
Sub CopyDocPathName()
Dim DataObj As New MSForms.DataObject
Dim SheetNarr$, TempPlural$
Dim SelectedObject As Variant
If ActiveSheet.Type = xlWorksheet Then
If TypeName(Selection) = "Range" Then
If Selection.Cells.Count = 1 Then TempPlural = "" Else TempPlural = "s"
SheetNarr = "Data source: " & ActiveWorkbook.Path & "\" & ActiveWorkbook.Name & " Tab [" & ActiveSheet.Name & "] Cell" & TempPlural & " " & Selection.Address
End If
End If
DataObj.SetText SheetNarr
DataObj.PutInClipboard
End Sub
TIA
Last edited: