Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word interop not working in main server

Status
Not open for further replies.

kylua

Technical User
Sep 30, 2002
199
GB
Hi All

I have an ASP.NET subroutine which converts an htm report into a word document for mailing out. I hit F5 in Visual Web Developer and it creates a test server on, say, port 1157, and works perfectly.
Run it on the operational server, port 801, and it fails to create the Word program object giving:
System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.

Literally, I change the '1157' to '801' in the web address and it fails.

And just to complicate things a bit more, I have another service on the 801 server that creates Word documents no problem!

I'm thinking security issues but cannot work out why it works with one but not the other. I've set the IIS security settings to be the same for both applications in case that made a difference and that failed.
I've transferred the class from the working application to the non-working application and referenced it and it fails.

Transferred the web.config from the working app to the non-working app, same error.

For the moment I'm hoping to bodge it by calling a routine in the working app from the non working app and do it that way.

But I would like to know what this is for future problems.
 
i would start here. if I understand the scenario correctly, you have a webpage which converts html to a word document and then emails the word document to a set of email addresses.

there are alot of disconnected systems here:
IIS: VS web server vs IIS.
OS: workstation vs Sever
MS Word: what version are you testing with? what version is installed on the server?
Email: are you using different email configurations for local development vs the testing server?

I have found access Office components directly from an asp.net application is usually not effective. To start Office Interops take a long time to load/execute. Not to mention versions of Office components can be a nightmare. If you cannot solve the problem I would recommend researching the "xml" word document. this allows you to build a string and save it as a .doc/.docx. the file is a text file instead of a binary file, but MS Word can still interpret the document. nothing is faster than building a string with the StringBuilder object. This also helps because you do not have to have office installed on the server at all.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Oh, I started with Google, but couldn't find anything.

The version of Word is not the problem as it works on the same machine on a different 'virtual' server.

It doesn't even get to the SMTP program but the development server is the same as the live server, I'm using exactly the same installation, same application, same files, same programs, same machine. Just a different server set up as the one it works in is set up by visual web developer but the one it doesn't work in is one set up in IIS directly.

But I'll look into the .xml file functionality, might be a work around. Becos I've tried referencing the working application to do it and it failed in exactly the same way.

Which suggests there is a set up issue within the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top