Visio Automation problem in Windows Server 2008 RRS feed

  • Question

  • Hi,
    I create a window service. The service does a simple job that is copying a visio template file to a new folder, rename, do some modification then save and quit the application. Here are the codes:

            Dim visioApp = New visio.InvisibleApp
            visioApp.EventsEnabled = False
            visioApp.UndoEnabled = False
            Dim visDocument As visio.Document

            ... copy the template to C:\Temp
            Dim FileVisioMap As String = "C:\Temp\VisioFile.vsd"
            visDocument = visioApp.Documents.Open(FileVisioMap)
            ... modify the file

    The service program works fine in Windows XP, Windows 2003 Server but it does not work in Windows 2008 Server. It generates an exception at the line "visDocument = visioApp.Documents.Open(FileVisioMap)".
    The error reports "An exception has occurred" and nothing else.

    The same line of code works perfectly in Windows 2008 if my program is a Windows application but it just refuses to work in a Windows service.

    Any help would be appreciated.

    Friday, March 5, 2010 12:01 AM


All replies