excel

Problem in reading Excel Sheet with Special Character in C#

Hi I am Using OLEDB to read Excel Sheet with C#. In that Column header Name is "Sr.No." in my "Sheet1". When i fetch Excel Sheet Data into my Datatable , i am getting "Sr#No#" as a column header name instead of original one. Can you please tell me why it’s happening so? And what is the solution for the same. Thanks. ...

Programatically saving a excel file from the web page

Hi, I have a web page which displays some report. When I click on the link for excel, it puts all the data that is displayed on the screen into a CSV file and opens a File Download window which lets me either Open, Save or Cancel. I want to download this file to a specified location programatically without the user seeing the File Dow...

Copy worksheet macro stops doing anything when the workbook hits 50 worksheets

Hey all I have a workbook that has a number of cover sheets and then a bunch of sheets at the back that are contain a few graphs. The graph pages are created by copy-pasting one sheet ("MasterFormat") over and over again, changing a few key values each time. The macro originally used to conk out fairly rapidly with a Copy Method of Wo...

Unable to access Excel's Application.ComAddIns property if there are no AddIns installed

This code snipped for the Windows Scripting Host displays the number of COM-AddIns currently installed into Excel. It works fine except for when there are no COM-AddIns installed. I believe it should output a "0", but instead it raises an exception (code 800A03EC). Does anyone know why? test.vbs Set objExcel = CreateObject("Excel.App...

OpenXML SDK Spreadsheet starter kits

I am trying to start working with excel documents through the OpenXML SDK Spreadsheet API. But I havent found any good guides or even examples on how to create a xlsx file from scratch. Only how to open an existing document and modify it. I have been thinking on having a empty template document and make a copy of it an then begin my pro...

Export an IQueryable Collection to Excel

I have a huge IQueryable that I want to export directly to Excel for data dumps, how would I do this? I was trying to put it into a GridView and export from there, which works if I use only a chunk of the data, but if I use the whole IQueryable, nothing happens. This is a table with 4k rows and each row has 70 or so columns. Edit: CSV...

Loading 32bit DLL using Excel 2007 (Vista 64bit version)

I discovered that I can NOT load any 32-bit DLLs using my version of Office 2007. I’m using Vista 64bit and I assume that Office is also in 64-bit mode. Is it possible to start Excel in 32-bit mode Or Is there a way to declare a DLL using VB to load a 32-bit DLL? Since I don’t have the source code to some of the DLLs I am using, I can’t...

What's the best way to extract Excel cell comments using Perl or Ruby?

I've been parsing Excel documents in Perl successfully with Spreadhsheet::ParseExcel (as recommended in http://stackoverflow.com/questions/429193), but I can't figure out how to extract cell comments. Any ideas? A solution in Perl or Ruby would be ideal. ...

How can I send the contents of a table or results of a sql query to the clipboard from an asp Page?

There are many examples on the internet of doing this type of thing. But none of them work in Firefox. So I thought I'd set the challenge for Stack Overflow users. Basically I need a very easy to use way for a user of a page to get the results of a query into the clipboard so that they can paste it into excel. It can either be getting ...

Excel with Reporting Services via WCF

Hi there, What is the best way of using Excel as the client for reporting services via WCF? I would like to do something along the lines of Excel calling a WCF service which sends back the URL of where the report is on the reporting server and then displays it. How would I go about this? What excel add-on, if any, do I need and how ca...

How to retrieve this computer's IP address?

What is the least cumbersome (module-inclusion, code lenght, etc) way to retrieve the machine IP address (of the first interface open)? I know of some solutions using MSINET, but I believe we can do better. Don't reply Function HomeIP() as Atring HomeIP= "127.0.0.1" End Function because it's not that funny... or correct. The scenario ...

Apache POI Color cell with formula

I want create a excel with Apache POI in java and I must insert in a cell a formula: A3=B3+C3. Is possible to insert another formula in A3 that color the cell if his value is> 0? I use Apache POI 2.5.1 ...

How do I remove a custom toolbar from an Excel workbook?

I'm using Excel 2007, and I have an Excel workbook with a custom toolbar attached. Every time I open the workbook, the toolbar appears on the ribbon under "Add-ins". I can right-click on the toolbar and choose Delete Custom Toolbar and that removes it. But when I re-open the workbook, it re-appears. How do I remove it for good? The tool...

Merge Excel Files Into One

I have a few hundred Excel files, where each file has some data on the first sheet. I've been asked to write a console application in C# which merges all of the Excel files together into a single document while retaining the formatting. The consolidated file is a single workbook containing a sheet for each file merged into the document....

In C# how to access excel headers using OLEDB (without Automation)?

This is my code where I am trying to access first row, first column string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + fileName + @";Extended Properties=""Excel 8.0;HDR=NO;"""; string CreateCommand = "SELECT * FROM [Sheet1$]"; OleDbConnection c...

Ways to deal with arbitrarily large sets of an arbitrary number of items in Excel

I have a specific case in mind, but the question applies in general too. How do you deal with data in Excel when the amount of data is arbitrary? In my specific case, I have a program which generates between 1 and 10 sets of data, each set consisting of 5 arbitrarily (but equally) long arrays (or you could consider it a table with 5 col...

How to write an Excel function which returns a value from an SQL database?

Hi all, I want to write the following function which should be used in an Excel worksheet: =GetRecField("Foo Record Key", "FooField1") ...which will connect internally through ODBC to an SQL database, execute there an SELECT FooField1 FROM MyTable WHERE KEY_FIELD='Foo Record Key'; and will return the resulting value as the result ...

Is there a Java Open source Library for parsing Excel 2007 Files?

Is there a Java Open source Library for parsing Excel 2007 Files? ...

Update Excel 2007 with OleDb

Attempting to execute an update command against an Excel 2007 file gives the error: Operation must use an updateable query. I'm using System.Data.OleDb with a connection string like this: Dim strConn As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=""" & pathToFile & """;" & _ "Extended Properties=""Excel 12.0;H...

Fastest function to generate Excel column letters in C#

What is the fastest c# function that takes and int and returns a string containing a letter or letters for use in an Excel function? For example, 1 returns "A", 26 returns "Z", 27 returns "AA", etc. This is called tens of thousands of times and is taking 25% of the time needed to generate a large spreadsheet with many formulas. p...