我有一个在我的电脑上运行的宏。当其他人运行它时,它会抛出以下异常:
"Run-time error '-2147221036 (800401d4)'
DataObject:PutInClipboard CloseClipboard Failed"
这是我的代码:
Dim buf As String, FSO As Object
Dim CB As New DataObject
Set FSO = CreateObject("Scripting.FileSystemObject")
With FSO.OpenTextFile(sFile, 1)
buf = .ReadAll
buf = Replace(buf, ",", Chr(9))
.Close
End With
With CB
.SetText buf
.PutInClipboard // Here cause the exception.
End With