Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 711
"Access Denied" error when calling Save() in ExcelWriter
When calling the Save() method of the ExcelWriter Application object, you receive an "Access Denied" error.
This problem is most likely caused by not including the METADATA tag that provides ExcelWriter with the values for its constants.

To fix this, please add the following line at the top of your page:
<!-- METADATA TYPE="TypeLib" UUID="{7BCD2133-64A0-4770-843C-090637114583}" -->

The "Access Denied" error occurs when Save() is called with constants passed to it such as SaveMethod and FileFormat without including the METADATA tag. If no constants are passed to Save() you shouldn't get an error.

For example, if you had:
objXLW.Save "test.xls", saOpenInPlace
without the METADATA tag, ExcelWriter would not understand the saOpenInPlace constant, and it would try to use the default SaveMethod which is saOpenInExcel when a filename is passed in. Since it doesn't have a complete path passed in for the filename parameter, it will try to save to a system folder that may not have the correct NTFS permissions.

The bottom line here is that you should use the METADATA tag in your script to avoid potential problems.

You can find more about the Save() method here: http://support.softartisans.com/ExcelWriter/doc/reference/ExcelAppObj.asp#Save

Related Links
OfficeWriter Home Page
OfficeWriter Enterprise Edition
Latest OfficeWriter News
OfficeWriter: Programmatic Runtime Control

Created : 8/15/2003 11:49:03 AM (last modified : 8/15/2003 11:49:19 AM)
Rate this article!