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
  1. Home
  2. General Programming
  3. C#
  4. Spreadsheet in C# [modified]

Spreadsheet in C# [modified]

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelpworkspace
3 Posts 2 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.
  • V Offline
    V Offline
    viciouskinid
    wrote on last edited by
    #1

    I have an excel spreadsheet where i can input some data and it does a number of calculations on that data. The calculations are quite complex as they rely on the results of other calculations within the spreadsheet. I am looking for a way to basically cut and paste the functionality and format of the spreadsheet into a C# program. I have has a little experience with datatable but i am no expert. Is there a way that i can setup a datatable with some inputs in the first few columns and then setup expressions to populate the remainder of spreadsheet. I am using visual studio express 2008. I know I can just use while loops but I was thinking there could be a simpler way to do it in VS Any help would be appreciated.

    modified on Tuesday, November 18, 2008 10:49 PM

    D 1 Reply Last reply
    0
    • V viciouskinid

      I have an excel spreadsheet where i can input some data and it does a number of calculations on that data. The calculations are quite complex as they rely on the results of other calculations within the spreadsheet. I am looking for a way to basically cut and paste the functionality and format of the spreadsheet into a C# program. I have has a little experience with datatable but i am no expert. Is there a way that i can setup a datatable with some inputs in the first few columns and then setup expressions to populate the remainder of spreadsheet. I am using visual studio express 2008. I know I can just use while loops but I was thinking there could be a simpler way to do it in VS Any help would be appreciated.

      modified on Tuesday, November 18, 2008 10:49 PM

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      A DataGrid or DataGridView is not a spreadsheet, nor does it work like one. You cannot put formulas in cells and expect them to work on other cells like excel does. You CAN put numbers into certain cells, but you have to provide all the code to do the calculations and put the results in whatever cells you need, then continue with more calculations as needed. Frankly, if you require that functionality, keep the stuff in Excel and write an Add-In for Excel to do whatever else you need. Google for "Visual Studio Tools for Office" for more information and downloads.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      V 1 Reply Last reply
      0
      • D Dave Kreskowiak

        A DataGrid or DataGridView is not a spreadsheet, nor does it work like one. You cannot put formulas in cells and expect them to work on other cells like excel does. You CAN put numbers into certain cells, but you have to provide all the code to do the calculations and put the results in whatever cells you need, then continue with more calculations as needed. Frankly, if you require that functionality, keep the stuff in Excel and write an Add-In for Excel to do whatever else you need. Google for "Visual Studio Tools for Office" for more information and downloads.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        V Offline
        V Offline
        viciouskinid
        wrote on last edited by
        #3

        thanks. I thought that was the case but i just wanted to check.

        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