Last post Oct 05, 2014 12:15 AM by sandywinlive
Oct 01, 2014 06:50 AM|sandywinlive|LINK
Working on a web app installed on 64 bit Windows 2008 OS and using 64 bit office 2010.
I have tried hard to find a fix for this. I am not able to open a word file programatically . I get this error as per stack trace
System.Runtime.InteropServices.COMException (0x800A175D): Could not open macro storage.
at Microsoft.Office.Interop.Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument, Object& WritePasswordTemplate,
Object& Format, Object& Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)
at Edenbrook.Hindsite.BL.DocumentHelpers.Word.WordDoc.Open(String strFileName).......
This basically opens up a template with dot extension . I have given appropriate permissions to the file/folder containing the file. with network service and also a service account user.
I have also followed up with a link http://support.microsoft.com/kb/224338 which gave me a solution as
To avoid the error, do one of the following:
Start Word as the Interactive User.
Start Word as a user with administrator rights.
Load the user hive for the user account programmatically, or have a dummy service that runs under the user account.
You must identify under what user account Word is running, and in what context you are developing. For example, if you are automating from a Microsoft Transaction Server (MTS) package, the default user account is IWAM_MachineName.
Now the thing is i have a user which i have impersonated but as per rule of the company he cannot be an administrator user of the server. Is there any alternative to this ?
Any alternatives to workaround this problem ?
Oct 01, 2014 07:03 AM|AidyF|LINK
You've already been told what you're doing isn't supported, Microsoft have never said that automating Word from asp.net will work, in fact the actively say it probably won't work. Even if you do manage to get your code working, I guarantee it will regularly
fail, you'll end up with orphaned instances of Word hanging around and eventually your code will just stop creating instances of Word altogether. Take it from us who have been there and done it already. The solution is that you need to use something intended
to be used from asp.net. Your options are Open XML SDK, or a third party component like Aspose. Aspose isn't free, but if you can afford a license to install Word on a web server such that it can be used by 1,000,000+ people, I'm sure you can afford Aspose
I appreciate this isn't the answer you are looking for, but no matter how many times you ask the answer will remain the same.
Oct 01, 2014 07:30 AM|sandywinlive|LINK
I get you . But by using OpenXml can you confirm that i won't be facing such issues ? There;s very little time for Development now. I am using the old Microsoft.Interop.Excel classes. I am not through with Open XML claases yet. How easy it is to implement
or map the existing Interop methods. ?
Oct 02, 2014 01:14 AM|Shawn - MSFT|LINK
For this error message, "System.Runtime.InteropServices.COMException (0x800A175D): Could not open macro storage", you could refer to:
Oct 05, 2014 12:15 AM|sandywinlive|LINK
Tried them both already. No respite.