excel

How to get Excel instance or Excel instance CLSID using the Process ID?

I'm working with C#, I need to obtain a specific instance of excel by it's process ID; I get the Process ID of the instance that I need from another application but I don't know what else to do, I don't know how can I get a running instance of excel given his process ID. I have researched a lot on the web, but I have only see examples o...

Excel VBA print to specific printer tray

In Excel (2007) VBA how do I print the worksheet to a specific printer tray? This will just print to the default tray on the printer: ws.PrintOut ActivePrinter:="\\print_server\printer_name" ...

Excel Date Field Conversion Problem

I currently have an excel sheet with one of the columns being in the date format. What I see when I open up the spreadsheet is something like 12/29/09 and the program sees 40176. I figured out this is the value present when I change the column to general text. My question is how can I read the value 12/29/09 instead of 40176 or how...

Are there such things as variables within an Excel formula?

I hate repeating functions, particularly in Excel formulas. Is there any way that I can avoid something like: =IF( VLOOKUP(A1, B:B, 1, 0) > 10, VLOOKUP(A1, B:B, 1, 0) - 10, VLOOKUP(A1, B:B, 1, 0) ) [The above is just a simple example of the problem, and not a particular formula that I'm working with.] ...

How to export pound symbol from a C# Web App to Excel correctly? (£ is produced instead of £)

We're exporting some data from a website app into an Excel spreadsheet, however, when a GBP symbol is used, instead of outputting "£9.99" it produces "£9.99". Here's the code a colleague has written to produce the spreadsheet [tableOut is a StringBuilder that contains an HTML table]: string filename = "EngageReplies.xls"; Response.Cle...

How do I get countifs to select all non-blank cells in Excel?

How do I get countifs to select all non-blank cells? I have two other criterions, so using counta alone is not an option. Using istext makes the result give 0, always. Excel gives an error when using <>"" as criteria. ...

Copy data from one sheet to other, on selection of data from the dropdown list.

Hi, Please help me in writing the Macro.I have no idea writing VB Macro and its SyntaX. The scenario is: An excel document has two sheets.The first sheet contains the marks,grades and project details of students. The second sheet contains the dropdown lists of Project version number, different Company names, and post. Project version...

Excel Sheet Project References

Hi All, I am programatically opening excel workbooks under a folder tree to check for some project references using the following code - workbook = app.Workbooks.Open(fileName,false,true,Missing,Missing,.....); foreach(Reference r in workbook.VBProject.References) { //check for a specific reference here } This works fine but m...

pyExcelerator or xlrd - How to FIND/SEARCH a row for the given few column data?

Python communicating with EXCEL... i need to find a way so that I can find/search a row for given column datas. Now, i m scanning entire rows one by one... It would be useful, If there is some functions like FIND/SEARCH/REPLACE .... I dont see these features in pyExcelerator or xlrd modules.. I dont want to use win32com modules! it makes...

Excel Print Worksheets by Name

I've got an Excel 2007 Spreadsheet and I'd like to write a VBA procedure to print particular worksheets by name. How do I do this? For example, I'd like to print "FirstSheet","ThirdSheet", and "FourthSheet" but not "SecondSheet". ...

Copying multiple worksheets simultaneously to preserve chart references

I've created a two-worksheet template in Excel - the first sheet is for pretty charts, and the other sheet is for the data that drives those charts. I've written a vb.net 2005 app that can dump in all my data on the second worksheet, and the chart worksheet updates perfectly. I would like to do this report several times over in the sam...

How to use use late binding to get excel instance?

I'm using [DllImport("Oleacc.dll")] static extern int AccessibleObjectFromWindow( int hwnd, uint dwObjectID, byte[] riid, ref Excel.Window ptr); to get an Excel Instance using his handle, which I get from the process ID of the excel instance. This is how it looks like when I use these function const uint OBJID_NATIVEOM = 0xFFFFFFF0...

Creating a Pop-Up Calendar in a VSTO Excel Project

I'm trying to use the System.Windows.Forms.MonthCalendar control within a VSTO Excel workbook. I want the MonthCalendar to pop up when I click a button in the ribbon, but so far I can't get the control to display at all. Private Sub DeliveryDateFromCalendarButton_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Rib...

Formatting Issues with Excel Interop using C#

I have a C# application that uses an existing Excel spreadsheet as a template and fills in data. In the template there is a blank row that has some style formatting such as font/border and data formatting such as currency and percentages. When filling in the data from the application I copy this row n times and fill in the data. The s...

C# using Excel Interop Updating Formulas

I have a C# application that builds Excel files from an existing template. On the template I want to have my row totals/averages in place and to update to however many rows are inserted by the application (Between the header and footer rows). This should be simple but I am drawing a blank in trying to remember how to do such a thing. ...

Print Embedded Excel sheet

Edit: I have a user control with embedded excel sheet and gridviews ( WinForm). I have a form which has that user control. I have a print button on top and I want to convert the whole form into printable format. Any suggestion on how to move ahead? ...

How to keep Excel interop from stealing focus while inserting images

I'm using the Excel COM interop to insert images (specifically EPS) into a spreadsheet. The images are inserted fine, but Excel ignores all the visible/background settings and steals the focus the display a dialog box saying something like "importing image". The dialog box only stays a fraction of a section, but it makes the screen fli...

Creating a sublist based on a second column in excel

I have two columns, the first column will have the name of a object, the second is who it belongs to. I want a new sheet for each person to list what they had assigned to them. here is a example: dog F cat F bell S whistle bird F So Fred has a dog, cat, and a bird; Scott has a bell; and no one has a whistle on their page. Now doing a...

How to select .NET framework version running from Excel?

How can I specify that Excel uses the .NET framework version 2.0 when running .NET dlls other than adding an excel.exe.config file to the Office Binary folder? Our application runs in Excel and uses VBA which makes calls into managed code in .NET assemblies. I believe the textbook way of doing this is to add excel.exe.config to the Off...

Unable to load the Excel 2003 Add-in

Hi, I'm trying to develop an Excel 2003 Add-in using Visual Studio 2008 (SP1).I didn't add any code expect for the boilerplate code added by Visual Studio. When I run the application in VS it loads up Excel, but the add-in itself does not work. The "COM Add-Ins" window list the add-in, but it's unchecked. The "Load Behavior" reads as "N...