473,473 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Create and save data to an Excel file with C#.net

I am trying many ways to create and save data to an Excel file, but all I got
is the following error message. (The code behind is in C#.net)

System.UnauthorizedAccessException
Here is my codes:

71: // Start a new workbook in Excel.
72: m_objExcel = new Excel.Application();
73: m_objBooks = (Excel.Workbooks)m_objExcel.Workbooks;
74: m_objBook = (Excel._Workbook)(m_objBooks.Add(m_objOpt));

Nov 18 '05 #1
1 5522
This article demonstrates a number of techniques for generating Excel and
Word documents.
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

Here's a good 3rd party product you could use if you need to get really
fancy:
http://www.aspose.com/Products/Aspose.Word/
And here's another:
www.officewriter.com

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Steve" <St***@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
I am trying many ways to create and save data to an Excel file, but all I
got
is the following error message. (The code behind is in C#.net)

System.UnauthorizedAccessException
Here is my codes:

71: // Start a new workbook in Excel.
72: m_objExcel = new Excel.Application();
73: m_objBooks = (Excel.Workbooks)m_objExcel.Workbooks;
74: m_objBook = (Excel._Workbook)(m_objBooks.Add(m_objOpt));

Nov 18 '05 #2

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

Similar topics

4
by: Aliza Klein | last post by:
I am new to ASP so please pardon me if this is crazy. I have data that I want to allow the user to be able to save in a format that will then enable the user to open the data in Excel. (I have...
7
by: Martin | last post by:
I have a situation where I'm displaying some information in a table on a web page. I've given the user the ability to make several different "queries" and show different sub-sets of the data. I...
8
by: Colleyville Alan | last post by:
I have been working on an Access app that takes info from a file and writes it to a spreadsheet on a form, simultaneously saving the spreadsheet to Excel. I got the idea that the same concept...
0
by: I Decker | last post by:
Hi all, Hope this is the right group. I am writing a program in c# to open create an excel document, enter some data, save it and then email it as an attachment. I have successfully created...
0
by: Thanks | last post by:
I would like to output a dataset to excel from a text file but did not work. I alreay add the microsoft active component 2.7 and 2.8 and microsoft excel 11 component library but no luck. Please...
3
by: S_K | last post by:
Hi, I have a problem when I try to save a .CSV file from an ASP.NET web page and the client has Excel open already. The symptoms are: 1) The web page is currently displaying the Excel...
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
0
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have...
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,...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.