Results 1 to 8 of 8

Thread: Excel issue in Local web server

Threaded View

  1. #1

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Thumbs up Excel issue in Local web server

    Hi all,
    I am using this code to get th ProcessID of newly Created Excel.

    Code:
    Imports Microsoft.VisualBasic
    Imports Microsoft.Office.Interop
    Public Class Class1
        <Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
      Private Shared Function GetWindowThreadProcessId(ByVal hwnd As Integer, _
                                ByRef lpdwProcessId As Integer) As Integer
        End Function
    
        Private processId As Integer
        Sub New()
            Dim oExcel As Excel.Application
            oExcel = CreateObject("Excel.Application")
            GetWindowThreadProcessId(oExcel.Hwnd, processId)
            oExcel.Quit()
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcel)
            oExcel = Nothing
        End Sub
    End Class
    This code returns the Process ID Correctly with Virtual Server
    Now I deployed it using a Website, and the ProcessID is 0

    Has anyone experienced with this ?
    Last edited by danasegarane; Jan 29th, 2010 at 07:32 AM.
    Please mark you thread resolved using the Thread Tools as shown

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width