Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Excel Automation

Excel Automation

Scheduled Pinned Locked Moved C / C++ / MFC
questiontestingtools
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chandrasekharan P
    wrote on last edited by
    #1

    In my application i am creating an excel file through Excel Automation. Now i am writing some values in the excel and then i am using Save() and Close() functions. Now i want to open the same file and then write and append it. how can i do that? i have already written in the first 2 columns. Then i am closing it. Later i want to write into the third column by opening it. give me some leads.

    M D 2 Replies Last reply
    0
    • C Chandrasekharan P

      In my application i am creating an excel file through Excel Automation. Now i am writing some values in the excel and then i am using Save() and Close() functions. Now i want to open the same file and then write and append it. how can i do that? i have already written in the first 2 columns. Then i am closing it. Later i want to write into the third column by opening it. give me some leads.

      M Offline
      M Offline
      MsmVc
      wrote on last edited by
      #2

      try to find find number of rows in used.Then start write into file. It may be help you

      long row;
      VARIANT varc=pRange->GetValue();
      if(varc.vt==VT_EMPTY)
      {
      }
      else
      {
      COleSafeArray sarect(pRange->GetValue());
      sarect.GetUBound(1,&row);
      }

      1 Reply Last reply
      0
      • C Chandrasekharan P

        In my application i am creating an excel file through Excel Automation. Now i am writing some values in the excel and then i am using Save() and Close() functions. Now i want to open the same file and then write and append it. how can i do that? i have already written in the first 2 columns. Then i am closing it. Later i want to write into the third column by opening it. give me some leads.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Chandru080 wrote:

        i have already written in the first 2 columns....Later i want to write into the third column...give me some leads.

        How are you writing to the first 2 columns?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        C 1 Reply Last reply
        0
        • D David Crow

          Chandru080 wrote:

          i have already written in the first 2 columns....Later i want to write into the third column...give me some leads.

          How are you writing to the first 2 columns?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          C Offline
          C Offline
          Chandrasekharan P
          wrote on last edited by
          #4

          I am using Excel Automation for that.. but i am trying to close the excel file and then open it again in a different function and then i am trying to append it again. that is not happening. I am using PutElement function to write the values into the excel file. but i am getting an exception there.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups