Hello, I have the following code that runs from within Excel to copy and paste a table in to Word between 2 bookmarks. I have to do this from Excel to Word as the company security protocols block running VBA in Word files.
As the code stands it works and I'm sure there are ways in which is can be improved but the issue I have is that it doesn't work for everyone and in theory we all have the same build of corporate laptops. I'm at a loss as to what might be causing the issue. At first some did not have the "Microsoft Word 16.0 Object Library" enable in Excel and this fixed 1 or 2, but some are still getting;
Run time error 4068 - Value out of Range
If debug is clicked it highlights the following line
wdDoc.Range(rngStart.End + 2, rngEnd.Start - 2).Delete
Now I've watch someone do this and I know they are using the right Word file with the bookmarks in, so very confused.
Many thanks for any tips or guidance as to where to look next, as I still think it a PC issue, due to the code working on other PC's
The full code
Please Login or Register to view this content.
Bookmarks