excel

VBA ActiveX controls grow in size over Remote Desktop Connection

We have an Excel workbook with a number of ActiveX controls, running in Excel 2003 on Windows XP. When connecting using Remote Desktop, the ActiveX controls change font, sometimes font size, and sometimes orientation (in the case of a spinner control). This happens on first connection and also as the workbook is used - some of the cont...

Export data in microsoft excel using C# windowsforms application

Hi, i got the exception when i am trying to export data to excel.... the exception is COMException: Exception from HRESULT: 0x800A03EC. How shall i solve this error? How shall i get solution? Tell me the solution of this problem... Thanks in advance... My Code is: { oxl = new Excel.Application(); oxl.V...

trying to launch a macro when the value of a DDE range changes

Hi there, I'm a novice in VBA but still I need yo execute a macro every time the value of a range changes. The marco is already written but if someone can help me with this issue, I will be very grateful. Just as you know the changing range is a DDE link updating the range with a continuous flow Thxs for your help ...

How to handle resize of range upon insert column/row in Excel via VSTO

Hi all, I'm working on an Excel add-in and have an issue with ranges. Suppose we have a range on a spreadsheet - A1:D1. A user inserts a column at say column C. My VSTO Range object is still A1:D1 but I'd like it to become A1:E1. UPD: I don't expect this to happen automatically, but I wonder is there a way VSTO would help me to impl...

c# Excel Interop alternatives to waiting to handle 0x800AC472 error

I have an application that writes many times to a formula/macro-laden workbook. It loops through some data 3 times creating, filling, saving, then closing an excel file in each iteration. While it works fine when it's the only version of itself running, if there are multiple instances of it running it has trouble. Specifically, I'm gett...

Inserting value into Excel cell instead of formula

Hi, I have a VBA script that inserts long strings into Excel cells. In some cases, the string begins with a '='. It seems like Excel interprets this as a formula and I get an 'Out of Memory' error due to the memory limitations of formulas. How do I tell Excel that I am writing a value, not a formula? Currently, I am doing this: ws.Ran...

SSRS Export to Excel has Wrong Group Footers

I have a SQL Server Reporting Services report that has several layers of groups. The groups have footers but no headers. Each sub-group's visibility is initially hidden and can be toggled from a cell in the footer of its parent group. The report renders fine in the browser. However, when I export to Excel the groupings are wrong. With t...

SumProduct over sets of cells (not contiguous)

I have a total data set that is for 4 different groupings. One of the values is the average time, the other is count. For the Total I have to multiply these and then divide by the total of the count. Currently I use: =SUM(D32*D2,D94*D64,D156*D126,D218*D188)/SUM(D32,D94,D156,D218) I would rather use a SumProduct if I can to make it ...

can't access the excel file in c#

Hi, I had a problem with my program for opening an excel file through the use of PIA. here below is my sample code; any suggestions? path = @"C:\\Test Template.xls"; wb = objExcel.Workbooks.Open(path, Missing.Value, Missing.Value , Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,...

How to create validation from name range on another worksheet in excel using C#?

I have create name range on sheet "A" so I need to use this range as validation ComboBox on sheet B. I want to know how can I setting validation as range using C#? ...

Insert row event in Excel VSTO?

Hi all, As a simpler way of saying "how to handle resize of range upon insert column/row in Excel via VSTO?": Is there a way in excel VSTO to handle "insert row" or "insert column" event? ...

Change Format of excel sheet Which exported from Datatable

Hi, I am using windowsforms Application and i exported my datatable to excel file successfully... now i want to format that excel sheet like column Name should be bold and display that datatable values as a table format and give background color to Columns and give different color to data rows...... How shall i format like this? plz ...

Highlighting the data with different colors in Excel Using C# in Windows Applications

I am working with a Windows application. I need to work out how to highlight the data with different colors & styles in Excel. I am using C# to export the data to excel. This is the code I am using to export a DataTable into Excel, private void btnExportexcel_Click(object sender, EventArgs e) { oxl = new Excel.Application(); o...

C# Graphics Book

I'm interested in using C# for graphics work. The book I have doesn't seem very interested in graphics. Could someone suggest a book that is more graphics-oriented? I am also interested in C interfacing with Excel. I'd be very grateful for any advice. Thanks! ...

Set Excel Named Ranges via C#?

Hi, I'm trying to replicate this Access VBA code using C#, but am unable to do so. Wondering if anyone else has tried this before and can help. oWB.Worksheets("Signoff").Range("rgSignOffRecTemplate").Value = g_TemplatePath & "Signoff_Rec.XLT" rgSignOffRecTemplate is a "Defined Name" in the Excel template that I'm trying to write to. ...

Cannot update Excel source properties in SSIS package

I have an SSIS package that imports an excel spreadsheet into an SQL Server 2008 database. I have an Excel connection in the Connection Managers tab and it points to an Excel file on my local computer. But when I open the Excel Source in Data Flow, if I try to view columns or change the "Name of Excel sheet:" I get this error. Error a...

Skipping rows when importing Excel into SQL using SSIS 2008

I need to import sheets which look like the following: March Orders ***Empty Row Week Order # Date Cust # 3.1 271356 3/3/10 010572 3.1 280353 3/5/10 022114 3.1 290822 3/5/10 010275 3.1 291436 3/2/10 010155 3.1 291627 3/5/10 011840 The column headers are actually row 3. I can use an Excel Sourch to...

Stop Excel from changing cell contents, ever

I work with card numbers, like credit card and ID numbers. We do not do any calculations with card numbers, obviously. They are "text." I format them as text, I type them like text. I know how that works. Excel doesn't care. 16 digit card numbers get their last digit turned into a zero, changed into scientific notation, stupid stuff tha...

COMException (0x80010108 - RPC_E_DISCONNECTED) When Closing Excel.Workbook

When I run the following code, I get the exception below: ''# NOTE: ExcelApp is a Private main form variable Dim ReportBooks As Excel.Workbooks = ExcelApp.Workbooks Dim ReportBook As Excel.Workbook = ReportBooks.Open(localFilename) Dim ReportSheet As Excel.Worksheet = ReportBook.Sheets("Report") ''# Retreive data from sheet ReleaseCOM...

Simple C# CSV Excel export class

Thought this might be handy for someone, this is an extremely simple CSV export class that I needed. Features: Extremely simple to use Escapes commas and quotes so excel handles them fine Exports date and datetimes in timezone-proof format Without further ado: using System; using System.Data.SqlTypes; using System.IO; using System.T...