Error while publishing the application to server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nudrat
    New Member
    • Aug 2007
    • 38

    Error while publishing the application to server

    Hi All,
    The scenario is as follows:
    In my application, I am manipulating with Excel files. Reading , copying some values etc. It works fine as long as it is running from working directory (Local system).
    I am publishing this application to a web server by publishing web site option from Build Menu in Visual studio editor. it gives error that Its unable to open the file.
    the location where the Excel file are placed are within the application only..
    Plz have a look n give some suggestion.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Hi; I removed your other identical thread. There is no need to double post.

    kind regards,

    Jos (moderator)

    Comment

    • nudrat
      New Member
      • Aug 2007
      • 38

      #3
      actually after posting the first post, I was unable to view that.. That's why I posted again with the same content.

      Regards
      Nudrat

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by nudrat
        actually after posting the first post, I was unable to view that.. That's why I posted again with the same content.

        Regards
        Nudrat
        If you want to view all threads you've started just click the My Subscriptions link near the top of the page.

        P.S How are you specifying the path to your excel files?

        Comment

        • kenobewan
          Recognized Expert Specialist
          • Dec 2006
          • 4871

          #5
          Originally posted by nudrat
          Hi All,
          The scenario is as follows:
          In my application, I am manipulating with Excel files. Reading , copying some values etc. It works fine as long as it is running from working directory (Local system).
          I am publishing this application to a web server by publishing web site option from Build Menu in Visual studio editor. it gives error that Its unable to open the file.
          the location where the Excel file are placed are within the application only..
          Plz have a look n give some suggestion.
          Most errors of this nature occur from absolute local paths or permission probs. What was the error meesage and was there an error number?

          Comment

          • nudrat
            New Member
            • Aug 2007
            • 38

            #6
            in the begining Files were there in the application itself, and I was reading it through Server.Mappath( ) method. But as it was giving problem, so I tried to write a function , which just creates an instance of Excel Application. the code is as follows: this code is in VB.NET

            Protected Sub Button1_Click(B yVal sender As Object, ByVal e As System.EventArg s) Handles Button1.Click
            fnReadExcel("Se rverName")
            End Sub

            Public Function fnReadExcel(ByV al ServerName As String) As Boolean
            On Error Resume Next
            objApp = GetObject(Serve rName, "Excel.Applicat ion")
            If Err.Number Then
            Err.Clear()
            objApp = CreateObject("E xcel.Applicatio n", ServerName)
            End If
            If objApp Is Nothing Then
            Return False
            End If
            Return True
            End Function

            It is working fine, till it is there at local system. when I am publishing this to server, it is unable to create the instance of Excel. Moreover, my Local system is acting as a Server.
            Please have a look n provide solution.

            Regards
            Nudrat

            Comment

            Working...