我尝试了下面的代码,并不断得到一个
调试错误(运行时错误'429' ActiveX组件无法创建对象)
在
Set ojbNotepad = CreateObject(Notepad.Application")
Sub CopyRangeToNotepad()
Dim objNotepad As Object
Dim strText As String
Dim rng As Range
Dim i As Integer, j As Integer
' Set the range that you want to copy
Set rng = Range("A1:B5")
' Copy the range to clipboard
rng.COPY
' Open Notepad
**Set objNotepad = CreateObject("Notepad.Application")**
objNotepad.Visible = True
' Paste the range into Notepad
objNotepad.Documents.Add
objNotepad.Selection.Paste
' Release the object
Set objNotepad = Nothing
End Sub
知道它为什么一直这样吗
我尝试了上面的方法,得到一个调试错误
1条答案
按热度按时间xt0899hw1#
尝试