Article ID: 303737 - Last Review: January 31, 2007 - Revision: 3.1 FP: Error Message: Permission Denied Running VBA Macro in HTML ViewThis article was previously published under Q303737 SYMPTOMS
When you run a Microsoft Visual Basic for Applications macro in HTML view, you receive the following error message:
Run-time error '70': Permission denied.
Run-time error '-2147418113 (8000ffff)': Automation error Catastrophic failure.
-or-
Run-time error '-2147418113 (8000ffff)': Method 'insertAdjacentHTML' of object 'DispIHTMLUnknownElement' failed. CAUSE
This problem can occur if the Visual Basic for Applications macro uses a method to manipulate the HTML on the page when in HTML view. For example, if you use either the InsertAdjacentHTML or the CreateRange methods, you may receive the error message described in the "Symptoms" section.
RESOLUTIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To resolve this problem, add code to your macro that changes the view mode to Normal view before editing the HTML. The following sample macro is a template for a Visual Basic for Applications subroutine that stores the original view mode, switches to normal view to execute any code, and then resets the original view mode:
MORE INFORMATIONFor additional information about working with Visual Basic for Applications methods and HTML, click the article number below
to view the article in the Microsoft Knowledge Base:
242315
(http://support.microsoft.com/kb/242315/EN-US/
)
FP2000: How to Insert HTML at the Insertion Point by Using VBA
| Article Translations
|
Back to the top
