CreateObject error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bremze

    #1

    CreateObject error

    I am stuck and have run out of ideas...

    I am trying to perform this in Visual Studio 2005 using .NET 2.0.
    Dim appl As Object
    appl = CreateObject("W ord.Application ")

    Works fine in VisualStudio 2003 using .NET 1.1.

    Here it throws this error:
    Request for the permission of type
    'System.Securit y.Permissions.S ecurityPermissi on, mscorlib, Version=2.0.0.0 ,
    Culture=neutral , PublicKeyToken= b77a5c561934e08 9' failed.

    What magic do I have to perform to get rid of it?

    Thanks a lot!
  • Ken Tucker [MVP]

    #2
    RE: CreateObject error

    Hi,

    I would avoid late binding. Try adding a reference to the word
    primary interop assemblies instead.

    Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows 11, Surface, and more.


    Ken
    ------------------------

    "bremze" wrote:
    [color=blue]
    > I am stuck and have run out of ideas...
    >
    > I am trying to perform this in Visual Studio 2005 using .NET 2.0.
    > Dim appl As Object
    > appl = CreateObject("W ord.Application ")
    >
    > Works fine in VisualStudio 2003 using .NET 1.1.
    >
    > Here it throws this error:
    > Request for the permission of type
    > 'System.Securit y.Permissions.S ecurityPermissi on, mscorlib, Version=2.0.0.0 ,
    > Culture=neutral , PublicKeyToken= b77a5c561934e08 9' failed.
    >
    > What magic do I have to perform to get rid of it?
    >
    > Thanks a lot![/color]

    Comment

    Working...