.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

OpenXML Add commnet to Spreadsheet

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I'm trying to add comments to cells in an Excel 2007 spreadsheet. I'm using the OpenXml SDK 2.0 to do so.

My use case is, I am editing Excel file and adding comments as my starting point,

Problem is that when I add Comment to the Comments part the spreadsheet doesn't load and Excel asks if I want to recover. Comments I added programmatically are not showing.

here is my code

                    WorksheetCommentsPart commentsPart = worksheetpart.AddNewPart<WorksheetCommentsPart>();
                    ssXML.Comments comments1 = new ssXML.Comments();

                    ssXML.Authors authors1 = new ssXML.Authors();
                    ssXML.Author author1 = new ssXML.Author();
                    author1.Text = "Author";

View Complete Post

More Related Resource Links

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Importing Excel 2007 spreadsheet into WSS 3.0 -- Error Message



I'm trying to import (Custom Lists >> Import Spreadsheet) into WSS 3.0 and I'm getting the following message: 

Refers to the _layouts

You are not authorized to view this page.  You might not have permissions to view this direcotyr or page using the credentials you supplied. [More stuff here.]

Http ERror 403 - Forbidden

Is this just a permissions problem or is there some other underlying issue?  Should you be able to upload an Excel spreadsheet (with links) into a Custom List?


Thanks! Patti N.

OWC11.Spreadsheet.11 - Retrieving the COM class factory for component with CLSID {} failed due to th

We have a web application (C#) which uses OWC11.Spreadsheet.11 to create excel files. This application works fine on XP 32bit, Windows 2003 server 32 bit versions. Recently we moved our application to a Windows 2008 web server 64bit machine. Now when we run the appication and call the functionality generate the Excel files which uses OWC11.Spreadsheet.11 it throws the following error.Retrieving the COM class factory for component with CLSID {0002E559-0000-0000-C000-000000000046} failed due to the following error: 80040154.In the code we use this library as follows using Microsoft.Office.Interop.Owc11; SpreadsheetClass xlsheet = new SpreadsheetClass();We have registered the Microsoft.Office.Interop.Owc11.dll in the global assembly cash as we have done in 2003 server.  We also tried running owc11.exe to insall all office 2003 web components.Can anyone help us to sort this issue.Thanks in advance.Sam

How to use OPENXML to load XML data into existing SQL Table?

I am a newbie to OPENXML. But I am trying to load a .XML file into a SQL table that I created for this. I do not receive any errors with this code, but it doesn't insert any records either. This is the table I created in 2008 SQL Server: CREATE TABLE HOMEROOM( HOMEROOM_TEACHER INT, HOMEROOM_NUMBER INT, ENTITY_ID INT) And this is the T-SQL code I am trying to execute: DECLARE @idoc int DECLARE @xmlDocument varchar(MAX) DECLARE @Status INT SET @xmlDocument =' <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"> <s:Schema id="RowsetSchema"> <s:ElementType name="row" content="eltOnly"> <s:AttributeType name="c0" rs:name="HOMEROOM-TEACHER" rs:number="1" rs:nullable="true"> <s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true" /> </s:AttributeType> <s:AttributeType name="c1" rs:name="HOMEROOM-NUMBER" rs:number="2"> <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="10" rs:maybenull="false" /> </s:AttributeType> <s:Attri

Document Library "export to spreadsheet" doesn't export all columns in Excel 2003

Hi, we are working with MOSS 2007, Infopath Forms Services, KPIs and Excel 2003. There is a view for some data of the Infopath forms which has to be exported to Excel by our users, but some columns are not exported - without any error message. If I try to export it to Excel 2007 everything is exported as expected, but our users have to use Excel 2003. Any idea?

Import Excel spreadsheet To Sharepoint List

Hi, I am having sharepoint 2010 RTM trial on Windows Server 2008 SP2. I want to populate csv filke data to new sharepoint list. I am using custom List Wizard to achieve this... When I Import csv on server then everything is fine but when i inport csv from client, i get the following error "The Specified is not valid Spreadsheet or contains no data to import" I have also checked to import excel workbook but it gives the same error on client and do great on server..... can anybody have any idea what is wrong ?? thanks

Text truncated to 255 using SSIS ACE.oledbprovider to import excel 2007 spreadsheet

Hi All, Trying to use SSIS SQL 2005 to import an Excel 2007 file (.xlsx). I'm using Office 12.0 Access Database Engine OLEDB Provider with extended properties Excel 12.0;HDR=Yes;IMEX=1 The problem is when I have text with more than 255 characters. It basically defaults the source output to Unicode string[DT_WSTR] 255, If I change it it errors out. I have done the registry change according to http://msdn.microsoft.com/en-us/library/ms141683.aspx but I think it only applies to Excel source not OleDb Source. (A Excel source does give me a text instead of string )   I have also tried to increasing the length of output such as 4000 instead of 255 but it doesn't allow either.   Anybody can help?I'm stuck for a day. Thank you very much for your help. Regards, Koala  

Adding data from Excel spreadsheet to SQL table

This is not a programming question, I simply have a lot of data in two columns in an excel spreadsheet of data that I gathered.  I want to copy and paste this (manually) into a table that I have created in my ASPNETDB in my ASP.NET web application.  I thought it'd be as easy as copy the column, and hit paste in the "table data" view, but it's not (it only pastes one cell).Is there a way for me to manually copy data from excel and paste it in a table in my SQL Server?Thanks in advance! :)

Reading Excel Spreadsheet from Cell A7

I don't know a lot about SSIS.  I have an excel spreadsheet where cell A1 and A2 have varchar values and B1 and B2 have decimal values.  Rows 3, 4, and 5 are blank.  Row 6 has the header column names and the data itself starts in A7 through F7.  I am not interested in rows 1 through 5.  The data ends in row 44.  Row 45, 46, and 47 are blank and in cell D48 it has the comment End of Report.  I am only interested in loading A7 through F44.  I do not know if the row count could grow or if it always stays at line 44.  Is there a way to tell SSIS to skip the first 5 rows, read the 6th row as the header and to start loading from A7?lcerni

Populate Excel Spreadsheet Starting At Specific Row

I am trying to populate an excel workbook using a data flow and it no longer works. I have a command button in cell a1, so the column headings need to start in row 3 and the data in row 4. also the column headings need to be red background. the data is ending up in the right row but no all the rows are also red. everything was working fine, now it is broken and cant figure out why. first i DROP TABLE, to clear the contents of the worksheet, this now only clears the column headings, the i CREATE TABLE, to put back the column headings, this works. Then using the data flow I populate the spreadsheet, it end up in row 3, which is right, but honetly i dnot know why. the problem is all the data rows are red. can anyone please help me with this. thanks.

Unable to see Export spreadsheet option under Actions Menu in Surveys

Created 30 surveys expected one survey every survey has Export spreadsheet option.The one which doesn't have Export Option has 924 Responses. I think there is no problem with FBA.Please let me know how to resolve. Thanks


I have a list id ID numbers contained in an xml document which i pass into a stored procedure. I want to change the a column to a set value for ALL the id's contained in the xml list, but for some reason I cant get it to work.  heres the sql  in the stored procedure EXEC sp_xml_preparedocument @idoc OUTPUT, @_xml BEGIN TRANSACTION UPDATE Table1  SET StatusID = @UpdateStatus FROM OPENXML(@idoc,'/Root/id',1) WITH (id bigint) ox WHERE Table1.ID = ox.id EXEC sp_xml_removedocument @idoc the sp compiles ok and is created, yet when I pass in the xml list, nothing is updated.  Can anyone see what im doing wrong here ?

Possible to Control Depth That OPENXML Parses xml document

I'm trying to parse a survey and only want to parse to a particular depth in the XML.  I want to preserve the hierarchical structure so that I can import it into SSAS and build a cube solution around the survey and the survey results. The structure of the xml follows this patten: <Survey Name="Medicare Inbound/Outbound Disenrollment Survey NY/NJ English"> <Introduction Text_English="Created by dcho on 3/23/2010." /> <   Question Tag="Inbound/Outbound" Type="Choice" Min="0" Max="40" Choices="inbound|outbound" Hint="" Question_English="(Select Inbound/Outbound and click Next)" /> <   Question Tag="Outbound Introduction" Type="Choice" Min="0" Max="40" Choices="yes|no" Hint="" Question_English="Hello may I speak with (disenrolled member)?&#xD;&#xA;&#xD;&#xA;(Select choice from dropdown and click Next)"> <   Condition Tag="Inbound/Outbound" Comparison="EQ" Value="outbound" /> </   Question> I only want to descend to the Question attribute so that I can pick up its Tag element.  I do not want to pick up the Condition attribute and its corresponding Tag element. I am using the following query,

Sharepoint export to spreadsheet gives two extra columns in excel 2007 named as type and path, is th

When i export a list in excel 2007, it creates two extra columns named as type and path. At the same time this behaviour is not exhibited in office 2000. Is there any way to remove these two columns without using code ? Is there any configuration settings required for this, to remove it on the fly ? Thanks Ravish Verma
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend