MS Word Error Running a Macro

Asked By 0 points N/A Posted on -
qa-featured

Hi,

I have Microsoft Office 2010 installed. I wanted to run a macro from Word and I got the error message shown below?

Please help me with an idea of what could be causing this error and how to solve it?

Run time error 5342  The specified data type is unavailable

Run time error 5342

The specified data type is unavailable

SHARE
Best Answer by Danny Ion
Answered By 0 points N/A #176479

MS Word Error Running a Macro

qa-featured

This particular error usually occurs when a .dll file is missing or unregistered. To fix this, try completing the following steps:

1. Open the Run prompt from the start menu.

2. Enter the following command: regsvr32 c:windowssystem32dllfile

3. Reboot your computer.

Another option is to download a registry scan tool and run it. You can get one from http://www.registry-scan.org/, for example.

 

Best Answer
Best Answer
Answered By 0 points N/A #176480

MS Word Error Running a Macro

qa-featured
Hi,
 
The error is generated when you try to paste an image using Paste Special macro which clear all kinds of formatting while pasting content in Word document.
 
To get around this problem, you need to modify you macro so that if the macro encounter any problem in pasting unformatted text, it should go ahead and complete the paste action using normal paste action. you need to include following sub-routine in your macro
 
 Sub PasteUnformattedText()
    On Error GoTo errHandler
 
    Selection.PasteSpecial DataType:=wdPasteText
    Exit Sub
  
  errHandler:
    Selection.Paste
  End Sub
 

 

Login/Register to Answer

Related Questions