Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-18-2019, 10:42 PM
petrimo petrimo is offline COMException 0x800A1492 Windows 10 COMException 0x800A1492 Office 2013
Novice
COMException 0x800A1492
 
Join Date: Feb 2019
Posts: 1
petrimo is on a distinguished road
Default COMException 0x800A1492

I'm getting an exception in my vb.net project:
System.Runtime.InteropServices.COMException (0x800A1492): You cannot paste this selection into a table. at Microsoft.Office.Interop.Word.Range.Paste()



The code is:
Code:
bookmark.Select()
_WordApplication.ActiveDocument.SetCompatibilityMode(Microsoft.Office.Interop.Word.WdCompatibilityMode.wdWord2013)
_WordApplication.Selection.Copy()
_WordApplication.Selection.MoveStart()
_WordApplication.Selection.MoveUp(Unit:=Word.WdUnits.wdLine, Count:=1)
_WordApplication.Selection.Range.Paste()
_WordApplication.Selection.Paste()
Bookmark is a table in word-template. The idea is to read values from SQL-database and insert several rows to table in word-document. I have tried with different versions of Microsoft.Office.Interop.Word.dll with no success.
This code works in older WIN7-environments but not in all WIN10-environments. In some WIN10-environment it works OK.
Any idea what could be wrong?
Reply With Quote
 

Tags
comexception, range.paste, wordapplication



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting COMException Incompatible file type and file extension sbalerao Mail Merge 0 04-21-2011 10:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft