how to open Existing Excel file ....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • student491
    New Member
    • Jan 2008
    • 4

    how to open Existing Excel file ....

    Hello,

    i tried to open existNg Excel file by using follow metho bt it give error ... that this file doestnt exist or path is incorrect...... ..

    wb = ThisApplication .Workbooks.Open (paramWorkbookP ath,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);

    & i also used this method tooo..
    it also doesnt work .. :(


    wb= ThisApplication .Workbooks.Open (paramWorkbookP ath, 0, true, 5,
    "", "", true, Excel.XlPlatfor m.xlWindows, "\t", false, false,
    0, true,Type.Missi ng, Type.Missing);

    //////////
    second thing how to read data from excel file & use it for charts...

    i am using Excel 2007 , C# 2005 ... all z doing using COM...

    waiting for reply..
    thanks......... ..
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by student491
    Hello,

    i tried to open existNg Excel file by using follow metho bt it give error ... that this file doestnt exist or path is incorrect...... ..

    wb = ThisApplication .Workbooks.Open (paramWorkbookP ath,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);

    & i also used this method tooo..
    it also doesnt work .. :(


    wb= ThisApplication .Workbooks.Open (paramWorkbookP ath, 0, true, 5,
    "", "", true, Excel.XlPlatfor m.xlWindows, "\t", false, false,
    0, true,Type.Missi ng, Type.Missing);

    //////////
    second thing how to read data from excel file & use it for charts...

    i am using Excel 2007 , C# 2005 ... all z doing using COM...

    waiting for reply..
    thanks......... ..
    There must be something wrong with your paramWorkbookPa th.

    Comment

    • student491
      New Member
      • Jan 2008
      • 4

      #3
      that problem of method z solved i gave the the wrong extention .. nw
      problem z no file z opened ... nothNg z happened...

      so plz help me out ...

      (i'm usNg C#2005, Excel 2007 & COM)

      thanks

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Originally posted by student491
        that problem of method z solved i gave the the wrong extention .. nw
        problem z no file z opened ... nothNg z happened...

        so plz help me out ...

        (i'm usNg C#2005, Excel 2007 & COM)

        thanks
        What? Do you think you could use proper English so I can tell what the heck you are talking about?

        Comment

        • student491
          New Member
          • Jan 2008
          • 4

          #5
          i used the followning fuctions But when i click the button ... nothNg is done ... ( means excel file didn't open).......... ..

          tring workbookPath = "G:\\test.x ls"; // Add your own path here
          Microsoft.Offic e.Interop.Excel .Workbook excelWorkbook = ThisApplication .Workbooks.Open (workbookPath, 0,
          false, 5, "", "", false, Microsoft.Offic e.Interop.Excel .XlPlatform.xlW indows, "", true,
          false, 0, true, false, false);

          or this one ........

          wb = ThisApplication .Workbooks.Open (paramWorkbookP ath,
          Type.Missing, Type.Missing, Type.Missing, Type.Missing,
          Type.Missing, Type.Missing, Type.Missing, Type.Missing,
          Type.Missing, Type.Missing, Type.Missing, Type.Missing,
          Type.Missing, Type.Missing);
          ///////////
          Can u please guide me ... how to open Existing Excel File ...

          & how to get data from it ...

          (i am using C# 2005, Excel 2007 & COM)

          thanks......... .......

          Comment

          Working...