excel

Exporting data to Excel

I need to export data to a formatted Excel document. Basically, a non-technical person should be able to create (or just modify) an Excel document that will be the template for the export process. The template should describe headers, used fields, etc. Knowing the template I have to export data to this document. Basically, it will look...

How to read, edit and write xls files, and then export to SQL Server

I have an excel file that have the list of contacts( about 10 k of them) that I need to push into my SQL Server database. So, I am writing an .net windows program using visual studio 2008 to read the files, generate random password for each contact, and then push these information in to my SQL Server database. It was easy to handle excel...

Excel VBA: how to programmatically remove the marching ants after range.copy

I don't want to resort to SendKeys "{ESC}" ...

Why am I getting an Out of Memory Error doing ASP .NET Excel Interop?

This was working..and I moved the disposal code to the finally block, and now it fails every time. I have a test spreadsheet with 4 records, 6 columns long. Here is the code I'm using to bring it in. This is ASP .Net 3.5 on IIS 5 (my pc) and on IIS 6 (web server). It blows up on the line right before the catch: "values = (object[,])ran...

Range limit conundrum

Hi, Is there some limit to what I can select in a range via VBA? Basically what I found is that if I were to hide an entire row while in a loop, it takes quite a while if there are lots of rows to hide. ex) - Hide any row that doesn't have a value in column A For i = 1 to 600 With Range("A" & i) If .value = vbEmpty then ....

What is the fastest method for importing from the active sheet in Excel to SQL Server?

What is the fastest way to import data into a SQL Server database directly from the active worksheet in Excel? I have had great success simply looping through the rows and columns, generating a SQL string, opening an ADODB.Connection and executing the SQL. That solution, however, is too slow for large datasets. So I am testing the Jet ...

JExcelApi: multiple formats in one cell?

In Excel, I can have multiple text styles in a single cell. Is there a way to create a file like this using JExcelApi? I'm not seeing anything so far: setCellFormat is a method on WritableCell, and there doesn't seem to be any way to set a format for anything within a single cell. Am I just missing it (quite possible!), or is this not...

single cell read only in excel using java

hi, how can i make a cell read only in excel using java Thanks in advance ...

C# Parsing Excel custom cell format

I am parsing an Excel file and am having difficulty reading in the value of a cell that has a custom cell format of dd mmm yy. The value in the cell in question is 29 Oct 09 (cell B25). When I run String arrive = Convert.ToString(_worksheets["GENERAL"].get_Range("B25", Type.Missing).Value2); I get "40114" as the cell's value. Th...

Pivot Table does not refresh automatically after refreshing the OLAP cube. Excel 2007.

I have a workbook connected to an external OLAP cube. Previously, when I connected to the external data source and then refreshed all, every pivot table would refresh and show the new data. Now, if I connect to the data source and refresh the pivots, the pivots do not update with new data. The only way I can get it to update is if I m...

How to export an Excel from dataset and save it into a specific path without showing the save as box

Hi, I have a code to exporting dataset to excel working fine, I want to exporting the excel into a specific location on the server, my code is down here and what changes should I do: Any ideas? public static void ExportDataSetToExcel(DataSet ds, string filename, string path){ HttpResponse response = HttpContext.Current.Response;...

How I can export a datatable to excel 2007 and pdf from asp.net?

I have to make reports with graphics in Excel and PDF from data in a database in an asp.net app. I don't want to use com objects so I have been using Open Xml Sdk to build the excel file from a template file and redirect the response to the new file generated but I don't know how to make the PDF file... I accept any comments about how I ...

Requested operation requires an OLE DB Session object... - Connecting Excel to SQL server via ADO

I'm attempting to take Excel 2003 and connect it to SQL Server 2000 to run a few dynamicly generated SQL Queries which ultimately filling certain cells. I'm attempting to do this via VBA via ADO (I've tried 2.8 to 2.0) but I'm getting an error while setting the ActiveConnection variable which is inside the ADODB.Connection object. I ne...

Excel VBA custom function with sumif-like criteria functionality

In Excel, I'm writing a custom function in VBA that needs to take a criteria string and criteria range like the built-in SUMIF function. Does Excel expose the functionality to test a criteria string anywhere in its API or do I have to write it myself? In case it's relevant, I'm writing a "CountUniquesIf" formula, that counts the unique ...

MS Excel 2003 - Simple unselect question in Excel VBA when dealing with shapes

So I have an excel workbook that has a global mapping scheme in it. So I have a shape for each and every country in excel. Depending on the region select, relative to the data/query, it will shade regions/countries in various ways. So I know how to manipulate each shape in terms of colors, gradient shading, etc.... What I don't know ho...

Insert a Newline in Excel Formula (MacOS)

I am using MS Excel on a Mac. I have a formula. Guests!A1 & " " & Guests!B1 & I WANNA PUT NEWLINE HERE Guests!C1 ... How do you do this???? Thx! ...

[VBA ?] Rich text format (with formatting tags) in Excel to unformatted text

Hello, I have approx. 12000 cells in excel containing RTF (including formatting tags). I need to parse them to get to the unformatted text. This is the example of one of the cells with text: {\rtf1\ansi\deflang1060\ftnbj\uc1 {\fonttbl{\f0 \froman \fcharset0 Times New Roman;}{\f1 \fswiss \fcharset238 Arial;}} {\colortbl ;\red255\green2...

Determining the size of a merged area

Right, before we get off about merged cells, I hate them too, but I've to deal with them anyway. I cannot change anything about that now or in the future. As much as I would like to ;) Say I have some merged cells, I need to determine the amount of cells it spans. Say A1:A4 are merged, then I need to have the number of merged cells, 4, ...

how to import excel file of multiple sheets into a gridview

i have a application in ASP.NET where i upload excel file using Fileupload and saving it in a folder. and then viewing it in a gridview.but i am unable to retrieve an excel file if it has multiple sheets.i have successfully done for a excel file having single sheet i.e sheet1.can any one solve the problem. thanks in advance ...

Error using excel ODBC driver in classic asp

I am getting this error when I try to load an excel document as a datasource for my webpage Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xd5c Thread 0x7e4 DBC 0x19acf74 Excel'. What is going wrong? ...