I am getting error code 438 with below code.
Private Sub Workbook_Open()
'On Error Resume Next
'Clipboard
a = Application.ThisWorkbook.Path & "\" & "CIMSR339A.DBF"
If Dir(a) <> "" Then
Sheets(1).TPath.Text = a
ActiveSheet.TName.SetFocus
Else
Sheets(1).TPath.Text = "Please browse the file."
ActiveSheet.BRun.SetFocus
End If
Dim DataObj As DataObject
Set DataObj = New DataObject
DataObj.GetFromClipboard
If Application.ClipboardFormats(1) = xlClipboardFormatText Then
Sheets(1).TName.Text = DataObj.GetText(1)
ActiveSheet.BRun.SetFocus
Else
ActiveSheet.TName.SetFocus
End If
End Sub
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.