I try to copy text form Excel and paste using PasteSpecial but it show error “Run-time error 438” at visApp.ActiveWindow.PasteSpecial 3
Sub CopyTextFromExcelToVisio()
Dim visApp As Object
Dim visDoc As Object
Dim copyRange As Object
Dim visPage As Object
Dim destpage As Integer
Set visApp = CreateObject("Visio.Application")
Set visDoc = visApp.Documents.Open("PATH")
Set copyRange = ThisWorkbook.Sheets("ToVISIO").Range("A1:B31")
copyRange.Copy
destpage = 8
Set visPage = visDoc.Pages(destpage)
visApp.ActiveWindow.Page = visPage
visApp.ActiveWindow.PasteSpecial 3
Set visDoc = Nothing
Set visApp = Nothing
End Sub
Please tell me how to solve it? T T
New contributor
Peeraput Prakhummin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.