Microsoft.Office.Interop.Word.Application works fine locally -- bombs when I publish application

827 views
Skip to first unread message

RBoyle

unread,
Apr 10, 2009, 2:35:34 PM4/10/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Here is my Imports statement at the top of the code behind:

Imports Microsoft.Office.Interop.Word

Here is one of the functions where I'm calling the class

Sub PrintEmployeeState()

'Dim strFileName As String
Dim word As New Microsoft.Office.Interop.Word.Application
Dim doc As Microsoft.Office.Interop.Word.Document


doc = word.Documents.Open("\\192.168.50.11\kdrive\Forms\EHS
\EMPLOYEE_STATEMENTS.doc")

doc.PrintOut()
doc.Close()

End Sub

** Why is it working perfect when I process it on my local machine, I
post it to the server, and it goes down the tolet and fires off an
exeption error. Below is the error message that it fires off on the
page load:


Server Error in '/EHSAccidentNearMiss' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: BC30002: Type
'Microsoft.Office.Interop.Word.Application' is not defined.

Source Error:



Line 338:
Line 339: 'Dim strFileName As String
Line 340: Dim word As New
Microsoft.Office.Interop.Word.Application
Line 341: Dim doc As Microsoft.Office.Interop.Word.Document
Line 342:


Source File: c:\inetpub\wwwroot\EHSAccidentNearMiss
\AccidentNMForm.aspx.vb Line: 340

Any ideas -- thanks for everyones help ahead of time!!

Ryan

Cerebrus

unread,
Apr 11, 2009, 4:08:41 AM4/11/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Are the Primary Interop assemblies installed on the server ?

http://support.microsoft.com/kb/328912/

Taf

unread,
Apr 12, 2009, 3:30:07 AM4/12/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Can you compile an Office Class Library of available functions
(basically just exposing an Office Interop) and then make that
available on your server as a Web Service?

Taf

P.S. Is WORD a type that the interpreter is getting confused?

RBoyle

unread,
Apr 11, 2009, 8:30:12 PM4/11/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I just installed the 2003 PRI install on my 03 server, I kicked off
the application again no go.

Any ideas?

Thanks for the help - much appriciated.

Ryan
> > Imports Microsoft.Office.Interop.Word- Hide quoted text -
>
> - Show quoted text -

zeki nadir aykose

unread,
Apr 12, 2009, 3:40:03 PM4/12/09
to DotNetDe...@googlegroups.com
Did you share this file:

 \\192.168.50.11\kdrive\Forms\EHS\EMPLOYEE_STATEMENTS.doc



2009/4/10 RBoyle <ryan.j.b...@gmail.com>

David Shen

unread,
Apr 13, 2009, 8:47:27 AM4/13/09
to DotNetDe...@googlegroups.com
have you put the interop file on the server?

you have office installed on the server. but you may not have the
interop file which is required for .net compilation on that server.

--
Best Regards,
David Shen

Reply all
Reply to author
Forward
0 new messages