Access Denied on Word.application instantiation


Hi there guys I have a little bit of a problem.

In a classic n-tier application that I wrote, I was firing up word and populating a template with info from a database.

To instaniate the word application object I would put (in a vb component)

I include a referece to word

In a function within the component I place the following code.

Dim m_objApp as Word.application
Set m_objApp = New Word.application

Everything works fine.


I want to achieve the same thing in .net

I again have a component

I include a reference to word

In a function within the component I place the following code.

Dim m_objApp as Word.application
Set m_objApp = New Word.application

I am present with an Enter Network Password popup.

If I cancel this then I am presented with an access is denied error.

I have no idea why, has anyone else.

James

Comments

  • Hi James,

    I am having the same problem. Do you have the solution. If yes please send it to me.

    Thanks

    Upen
    :
    : Hi there guys I have a little bit of a problem.
    :
    : In a classic n-tier application that I wrote, I was firing up word and populating a template with info from a database.
    :
    : To instaniate the word application object I would put (in a vb component)
    :
    : I include a referece to word
    :
    : In a function within the component I place the following code.
    :
    : Dim m_objApp as Word.application
    : Set m_objApp = New Word.application
    :
    : Everything works fine.
    :
    :
    : I want to achieve the same thing in .net
    :
    : I again have a component
    :
    : I include a reference to word
    :
    : In a function within the component I place the following code.
    :
    : Dim m_objApp as Word.application
    : Set m_objApp = New Word.application
    :
    : I am present with an Enter Network Password popup.
    :
    : If I cancel this then I am presented with an access is denied error.
    :
    : I have no idea why, has anyone else.
    :
    : James
    :

  • hmm this is strange but im not sure if it has anything to do with asp.net...

    can you give us some more info on your setup like computers, servers and how they are connected.

    by the way.. what happens if you enter your network info in that popup screen?

    -Q-
  • I have had similar problems in the past. It could be that the user "ASPNET" does not have permission to access the resource your are telling it to. The is a write up about .NET user impersonation. this link should help you : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetimpersonation.asp

    Jared

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories