473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# and Excel Suggetion

Hi

I need some hints for the following problem.

We have some customer that has one Excel file composed of about 20
sheets and he wants to convert this file to a small C# application.
It's not that he does not want to use Excel at all, but there is data
that has to be entered inside the first sheet and from this data all
other sheets are calulated.
Now he wants us to write some app, where his customers are able to
enter the required data into text-fields and this data should be
passed to an excel file. Doing this excel would calculate all other
sheet-fields.
Now those calculated values must be grabed and passed to an other
excel file, which does NOT hold the formulas for the calculation but
also has some additional charts and graphics which relay on the
calculated values.
This new excel file should then be shown to the user.

I thought of holding the "master" file inside a database and just
opening the excel sheet via automation in memory (just don t call
Show) and pass the entered values to this file and then opening a new
file (from a template) passing the calculated values, deleting the
temporary "master" file and then showing the final one.
The sheets of the "master" file will be password protected (to have at
least a litte security).

What do you think of this approach? Would you recomend to do the
complete proceses different?

_thanks in advance

rene

Jul 16 '07 #1
2 1631

A couple of basics:

You can use an IDataReader to read excel. You can also load the excel data
into a dataset.

Excel also has a "xml standard". To see this quickly, load an excel file
up, do a "Save As (Xml)", and then load the result file into notepad.

The last time I used the xml/excel thing, you could NOT embedd object graphs
into it.

the third hint is:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!148.entry
but this one doesn't exactly apply to you.

..............

You may want to look at the asrose excel toolkit as well.
http://www.aspose.com/Products/Aspose.Grid/Default.aspx
Those are some hints. Not a direct answer though.


<re*********@googlemail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.com...
Hi

I need some hints for the following problem.

We have some customer that has one Excel file composed of about 20
sheets and he wants to convert this file to a small C# application.
It's not that he does not want to use Excel at all, but there is data
that has to be entered inside the first sheet and from this data all
other sheets are calulated.
Now he wants us to write some app, where his customers are able to
enter the required data into text-fields and this data should be
passed to an excel file. Doing this excel would calculate all other
sheet-fields.
Now those calculated values must be grabed and passed to an other
excel file, which does NOT hold the formulas for the calculation but
also has some additional charts and graphics which relay on the
calculated values.
This new excel file should then be shown to the user.

I thought of holding the "master" file inside a database and just
opening the excel sheet via automation in memory (just don t call
Show) and pass the entered values to this file and then opening a new
file (from a template) passing the calculated values, deleting the
temporary "master" file and then showing the final one.
The sheets of the "master" file will be password protected (to have at
least a litte security).

What do you think of this approach? Would you recomend to do the
complete proceses different?

_thanks in advance

rene

Jul 16 '07 #2
On Mon, 16 Jul 2007 07:01:01 -0700, re*********@googlemail.com
<re*********@googlemail.comwrote:
[...]
Now he wants us to write some app, where his customers are able to
enter the required data into text-fields and this data should be
passed to an excel file.
Personally, it seems to me that you would be better off programming the
user-input form in Excel, rather than trying to get an external C#
application to work with Excel.

Not that the latter can't be done, but you'll have to jump through some
hoops, whereas if you code in Excel itself, it'll just work. You'll have
direct access to the spreadsheet(s) you want to interact with.

You might have to learn Visual Basic (very easy, especially if you already
know the Microsoft .NET languages), since I'm not sure whether you can
code C# directly from within the Excel macro IDE.

Alternatively, you mentioned using automation, which I think you ought to
be able to use simply to get the user input into Excel and operate on
whatever Excel objects you want. I don't see any particular problem
keeping the data in a database rather than an Excel spreadsheet
(especially if it's really database-like in nature), but I don't think
that aspect of the question has a direct bearing on how you implement the
UI.

Pete
Jul 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
3
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet...
6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
22
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody...
9
by: Anthony | last post by:
To me, creating Excel 2003 spreadsheets programmatically via VB.NET hasn't really changed since the days of VB6. That is, I'd do something similar to this Code: Dim ExcelApp As...
7
by: Alain \Mbuna\ | last post by:
Hi everybody. In my program I have some data that is calculated after some input from the user. I have written some code that opens an Excel workbook, with 5 worksheets and the calculated data...
16
by: alexia.bee | last post by:
Hi all, In some weird reason, excel instance won;t die if i remove the comment from 4 lines of setting values into struct. here is a snipcode public...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.