noveske
Board Regular
- Joined
- Apr 15, 2022
- Messages
- 120
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
Trying to copy text only. Testing with just basic line of text.
When running I get run-time error '1004':
PasteSpecial method of Range class failed.
Could it be that it's a merged cell? Tried to unmerge, then remerge. But it stops with the same error.
I've been using notepad, but would like to use Word for spell check.
Doing it this way since I have the sheet formatted to print to a form and line up with the boxes.
When running I get run-time error '1004':
PasteSpecial method of Range class failed.
Could it be that it's a merged cell? Tried to unmerge, then remerge. But it stops with the same error.
I've been using notepad, but would like to use Word for spell check.
Doing it this way since I have the sheet formatted to print to a form and line up with the boxes.
VBA Code:
Sub CopyOver ()
Dim WordApp As Object
Dim WordDoc As Object
Dim ExcelApp As Object
Dim ExcelSheet As Object
Dim FilePath As String
Dim sheetProtection As String
FilePath = ThisWorkbook.Path & "\101.docx"
Set WordApp = CreateObject("Word.Application")
Set WordDoc = WordApp.Documents.Open(FilePath)
WordDoc.Content.Copy
WordDoc.Close
WordApp.Quit
Set ExcelApp = GetObject(, "Excel.Application")
Set ExcelSheet = ExcelApp.ActiveWorkbook.Sheets("Input")
ExcelSheet.Activate
ExcelSheet.Range("A23").PasteSpecial xlPasteValues
Application.CutCopyMode = False
End Sub