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

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

Excel - Move or Copy using c#

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :ASP.Net
Hi Experts,            I need your help,i like to copy 2 sheets from one workbook to other one which I created newly.I am using VS 2008 with c#.Please give code snippets for move or copy sheets from one book to other. Thanks in advance RegardsDinesh babu.

View Complete Post

More Related Resource Links

Unable to copy/move wiki pages with links to other wiki pages

When I try to copy or move wiki pages from one 'Wiki library A' to 'Wiki library B' through 'content and structure', I get an error for the pages which contain links to other wiki pages, does sameone has a clue how to fix this:

<error><message>Het item bestaat niet. Mogelijk is het door een andere gebruiker verwijderd.</message><full>Microsoft.SharePoint.SPException: Het item bestaat niet. Mogelijk is het door een andere gebruiker verwijderd. ---&gt; Microsoft.SharePoint.SPException: Het item bestaat niet. Mogelijk is het door een andere gebruiker verwijderd. at Microsoft.SharePoint.SPListItem.EnsureItemIsValid() at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, Boolean bMigration, Boolean&amp; bAdd, Boolean&amp; bPublish, Object&amp; objAttachmentNames, Object&amp; objAttachmentContents, Int32&amp; parentFolderId) at Microsoft.SharePoint.Deployment.ListItemSerializer.AddOrUpdateDoclibItem(SerializationInfoHelper infoHelper, SPListItem&amp; listItem, SPWeb web, Guid newId, String&amp; listItemServerRelativeUrl, Boolean bIsPublish, Boolean exists, StreamingContext context, ISurrogateSelector selector, ImportObjectManager objectManager) at Microsoft.SharePoint.Deployment.ListItemSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurr

Invalid URL"" after copy or move a document.



We have an website that have 3 libraries. The "first Library" is used only to edit documents and it's called "my documents". When a user finish of edit your documents here, they start a workflow that will check fields in the document and move the document for the second library (using Sharepoint Designer Workflow - without custom actions).
In "second library" we have a big workflow. This WF has some steps for approve, collect feedback, generate sub-tasks and others things related for the document. This WF use many custom actions in (Sharepoint Designer).
When this WF arrives to the end, the document is moved to "third library", that is a official repository of documents in the enterprise.
The entire cycle works fine. But when someone creates a internal copy of the document in the "first library" to begin again the flow, we receive a Invalid Url error. It occurs when any update operations is executed over the document item, the value is conserved but the error is displayed. After it, we can not execute other workflows over the item.
If we save the document in local disk, delete the library item, and then upload it again, the problem is solved.

Some one have an idea about why and how solve it?  We are using WSS 3.0.

The following is an error registred in log file when you d

How to copy sqlServer table into excel sheet with sheet name as sheet1?

hello all,I want to copy each table(from selserver database) in separate sheet of Excelwith Sheet name different from table name..........So the issue is that when I open Excel Sheet it show sheetname same as filename I just want to name it as Sheet1,Sheet2 and so onI can copy table from SqlServer(MS Sql Server 2005) into Excel Sheet as follows:public static void ExportDataTableToExcel(DataTable dt, string filename)         {             System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;             // first let's clean up the response.object             response.Clear();             response.Charset = "";             // set the response mime type for excel             response.ContentType = "application/vnd.ms-excel";             response.AddHeader("Content-Disposition", "attachment;filename=\"" + filename + "\"");   &nb

Read only error trying to copy and paste rows of records from Excel spreadsheet


I'm using Sharepoint 2010 and trying to open a list in Edit in Datasheet View. The list opens but when I try to paste lines into the sheet I get a Read-only error and it doesn't accept my paste. I removed all required fields.

I'm using XP and IE8

This function was working in SharePOint 2007.


move table from excel to sql in pivot format.


Hi All, i have a table in excel as follows and i want to move all records from excel to sql but in pivot format.

field 1              S5803                      S5597                  S5825

A002             S5803_v12009       S5597_v12009        S5825_v12009

-----               --------------           -------------              --------------

and the table i want in sql as :

Code          Contract         MaterialCode

A002             S5803          S5803_v12009

A002             S5597       

copy / move pdf file in documents library sharepoint 2010



I have a document library that contains many folders with different documents.

The library contains various content types.

When I try to copy or move a pdf document from folder to another  folder. the pdf document is copied, but without his meta-data.
 and the content type the file becomes to  default content type of system, to  "document."

Copying is done by explorer window
 (ie the documents library open the document library explorer Explorer And where we do copying or moving documents .)

It should be noted that when doing "copy to" or "move to" of documents and type Microsoft Office the meta- data yes  copied properly.

The problem applies only to the pdf files.

How do I make a copy or move of the pdf document with his meta-data  by explorer window?

move records with $ sign from excel to sql.


Hi All, i have a simple table in excel with records as $0.00, $3.50, $15.0 and i want them in sql table exactly as they appear in excel. now, i tried using data conversion task and data type as currency[DT_CY] but it gives an error. and if use data type String then it moves all records but like 0, 3.5,15. how do i do this?



Move/Copy files between SQL servers.


Hi folks,

I would like to move/copy some files between two SQL servers.  The files are consist of .css .png .jpg and .gif files.  I've tried to do this using the File System Task but I can't for the life of me work out how I point it to the servers file system.  I'm obviously not an SSIS guru, I had a play and can move files around my own PC from location to location, but can work out my server to server issue, I hope someone can help, or at least point me in the right direction.

I'm going from SQL2005 to SQL2008 if that makes any difference, but as I say its not SQL tables, data, or what not, it's simply moving files that happen to be stored on the two servers.

Thanks in advance


How to connect two machines for directory/file operation like copy/move etc in C#


Hi All-

I wants to write c# code for a file transfer tool. My basic requirment is that, copying directories/files or moving directories/files from one machine to another machine.

For that I am populating source machine drives, directories and files into a first tree view control.

Now I wants to connect to onther machine which will be a destination machine and populate the drives, directories and files into second treeview control to copy/move the directories from source machine.

To connect, I will provide IPAddress, Port number, user name and password of destination machine.

To accomplish this,

which type of connections could be used?

How many connections type are there?

If the two machines are same LAN/Network how to connect together?

What is client/server connection mode?

What type of transfer protocal could be used?

Please give all the details about this.

Thanks in advance

Copy phone numbers from results grid to excel, numbers have leading 0


Hi I need to copy a column of phone numbers into excel they should be treated as text however excel wants to treat it as a number.

Is there anything I can do to force excel to treat the copy and paste from management studio as text and retain the leading 0?

Which task would use to copy, move or delete files in SSIS

can any one help me for this question any link of examples for the same highly appreciable
Regards, Amitesh Srivastva

IE problem with copy past from Excel to IE


Hello, guys

Im having a problem with ie only, firefox , chrome and opera work fine if i copy some values from a column an excel an past to a textbox,

but at IE is pasting just first value .....

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

Excel Automation in .Net

Excel Automation is a buzz word in both webapps and winapps. In the programming life (like Mr.Anderson neo) I guess almost every one could have come across this word. For others let me go further in detail. Excel Automation is automating some or all of the process involved in creating or updating excel worsheets.

display data into GridView from excel sheet

I have to display data from excel sheet into my gridview and also I need to figure out a way to store data into excel files from my web page. I am using C# 3.5, VS 2008.

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.
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