How to read excel in reverse Order located on server??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Question123
    New Member
    • Feb 2008
    • 41

    How to read excel in reverse Order located on server??

    Hi Friends

    How to read excel worksheet on server in reverse direction??
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Originally posted by Question123
    Hi Friends

    How to read excel worksheet on server in reverse direction??
    Why not read it into an array or matrix in the correct order, and then read it from the array/matrix backwards?

    Comment

    • Question123
      New Member
      • Feb 2008
      • 41

      #3
      Thanks for reply.

      But my need is to read Excel file's Col A and Col B in reverse direction.
      And main condition is that Excel file is located on server.Not on same machin where i run program.

      Thanks & Regards
      Question123

      Comment

      • Question123
        New Member
        • Feb 2008
        • 41

        #4
        How to read excel in reverse Order located on server??

        Hi
        I want to read Excel file's Col A and Col B in reverse direction.
        And main condition is that Excel file is located on server.

        Plz help me.

        Thanks & Regards
        Question123

        Comment

        • Curtis Rutland
          Recognized Expert Specialist
          • Apr 2008
          • 3264

          #5
          Originally posted by Question123
          Hi
          I want to read Excel file's Col A and Col B in reverse direction.
          And main condition is that Excel file is located on server.

          Plz help me.

          Thanks & Regards
          Question123
          Was there some reason that your first post asking the exact same question wasn't good enough?

          As to your question, I suggest you google Microsoft.Offic e.Interop.Excel to learn how to read from Excel sheets. Then reading backwards is as simple as counting down in a loop instead of up.

          Comment

          • Question123
            New Member
            • Feb 2008
            • 41

            #6
            Thanks for reply..

            Hello

            Excel on server containing daily data from 1984 to todays date. And if in my database i have data updated already just last 2-3 days data was not there as compaired to excel.
            So i want to know used row count (i.e. rows having data) of Col A and Col B so i can read data from that end.(i.e. Reverse upto last 2-3 days ) and skip all other excel reading.

            i am try to get that with this code


            *************** *************** *************** *************** *************** *************** **

            ApplicationClas s xlApp = new ApplicationClas s();

            Workbook xlWBook = xlApp.Workbooks .Open(sFileName , 0, false, 5, "", "", false,
            Excel.XlPlatfor m.xlWindows, "", true, false, 0, true, false, false);

            Excel.Sheets xlSheets = xlWBook.Sheets;

            foreach (Worksheet xlWSheet in xlSheets)
            {
            Int64 Max = Convert.ToInt64 (xlWSheet.UsedR ange.Count.ToSt ring());

            Max = Convert.ToInt64 (xlWSheet.Rows. Count.ToString( ));
            }

            *************** *************** *************** *************** *************** *************** **

            But it not giving me UsedRange of perticular column so how should i get that.
            Plz help me.

            (I dont want to use loop to find UsedRange of Column bcz it will be equal to reading excel from 1984 to todays date)

            Thanks & Regards
            Question123

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              Threads merged.
              Please do not continue to post duplicate questions, it's against the posting guidelines.
              MODERATOR

              Comment

              • Question123
                New Member
                • Feb 2008
                • 41

                #8
                How to read excel in reverse Order located on server??

                Hello

                Excel on server containing daily data from 1984 to todays date. And if in my database i have data updated already. just last 2-3 days data was not there as compaired to excel.
                So i want to know used row count (i.e. rows having data) of Col A and Col B so i can read data from that end.(i.e. Reverse upto last 2-3 days ) and skip all other excel reading.

                i am try to get that with this code


                *************** *************** *************** ***** *************** *************** ************

                ApplicationClas s xlApp = new ApplicationClas s();

                Workbook xlWBook = xlApp.Workbooks .Open(sFileName , 0, false, 5, "", "", false,
                Excel.XlPlatfor m.xlWindows, "", true, false, 0, true, false, false);

                Excel.Sheets xlSheets = xlWBook.Sheets;

                foreach (Worksheet xlWSheet in xlSheets)
                {
                Int64 Max = Convert.ToInt64 (xlWSheet.UsedR ange.Count.ToSt ring( ));

                Max = Convert.ToInt64 (xlWSheet.Rows. Count.ToString( ));
                }

                *************** *************** *************** ***** *************** *************** ************

                But it not giving me UsedRange of perticular column so how should i get that.
                Plz help me.

                (I dont want to use loop to find UsedRange of Column bcz it will be equal to reading excel from 1984 to todays date)

                Thanks & Regards
                Question123

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  Threads merged again.

                  Do NOT continue to double post your questions. This grinds my patience, something I have little enough of to begin with. There are posting guidelines for a reason.


                  MODERATOR

                  Comment

                  Working...