excel

using for each loop in visual basic for developers in excel to copy on visible values

Hey all, I would like to use a for each loop in excel to copy only all visible values in my excel spreadsheet in order to remove the link from the auto filtering so that when I export or copy these values, the hidden values from the auto filter don't come back. Here's macro: Sub sortify() Application.ScreenUpdating = False Range("A...

Office-agnostic way to access data in a .xls file?

I'm working on a VS 2008 C# program that needs to get data out of an excel spreadsheet. Problem is that the users run a mix of office 2007 and Office 2010. So I'm trying to get some pointers in the right direction on a way to programmatically get data out of the xls that doesn't care which version of office the user has installed. Bon...

how to write to dynamically created worksheets in excel using Pear Spreadsheet Writer?

In short what i want to do is, create several worksheets dynamically, populated with data from a database result. So far i'm getting: Fatal error: Call to undefined method PEAR_Error::write() in /mnt/hgfs/workspace/CCMS-Web/reports/file-excel.php on line 113 When i'm trying to do this: $workbook = new Spreadsheet_Excel_Writer(); //...

Excel 2003 Get dropdown value in VBA and get the name of the dropdown...no where to be found?

I created a dropdown by dragging the combo box onto my sheet from the UserForm toolbar. I assigned some values to it from some cells in the book. Now I want some vba code to access the selected dropdown item's value in form of a string. My dropdown contains only text. Also how do I find the name of this newly created dropdown...it's n...

VBA in New Versions of Excel

Here is a question for my Father. He has been using VBA in Excel for more than two decades going from Excel 5 to this day where he is using Excel 2002. As he has used VBA in Excel for so long, making extensive use of the ability to record macros, he has continued to invest in Excel as it has been rather stable (in terms of its VBA func...

How to parse in VBA a string that contains Mathematics special ASCII code and correct it

Hi ! I'm currently writing a code in VBA to retrieve prices for some financial models. The problem I have is in the excel spreadsheet where I have special Ascii characters like ⅞ ¼ etc... I would need using VBA to transform this in 7/8 1/4 etc... How could I do that ? Thanks for your help ...

knot points at specific points in the chart

How do I mark knot points at specific points on the curve not all. For example, I plot the following curve - (x1,y1) (x2,y2) (x3,y3) (x4,y4) (x5,y5) I want to mark knot points on x2 and x4. Is there some way to do this? ...

Excel UDF 'not a valid addin' error

I am trying to create a custom vb.net Excel 2007 function (UDF) using VS 2010 and have gotten to this stage (borrowing heavily from Eric Carter's example at http://blogs.msdn.com/b/eric_carter/archive/2004/12/01/273127.aspx): Namespace AutomationAddin <Guid("1aeeb1b5-e099-4f7f-aeb0-3e9f19b64f62")> <ClassInterface(ClassInterfaceT...

How to make wpf application as ole server

Hi, I would like to insert my wpf application in excel sheet just like an OLE object. Is it possible? If yes, how we can do this. In Excel 2003 when we click Insert->Object menu item, we get the 'Object' diloag. The 'Create New' tab of this dilaog contains varios OLE objects. I would like to display my DotNet exe application in this li...

Export Excel Chart In C#

Hello. My question on export(). //export chart as picture file chartPage.Export(@"C:\excel_chart_export.bmp","BMP",misValue ); I am using vs2008, office 2003 installed( Microsoft Excel 11.0 Object Library). It doesn't work when I try to export BMP file. I followed the sample code as below. Then I change the file type to .jpg and J...

Convert Excel Cell Value From Text To Number Using C#

Hi, I am using Windows Application. In that Application i exported the DataGrid into Excel Successfully... Now the problem is , When i exported from Grid to the Excel Sheet, The cell values are having some green color mark on left top corner in the Excel Sheet... I thought that is type cast problem . How Shall i avoid that Problem.... a...

Save mysql query to excel file from php webpage

Hi, I have a table within a mysql database. What i want to do, is in a php page, run a select statement and output the result into an excel file. I've seen quite a few tutorials out there and tried them, however these output the contents of the webpage into the excel file. I just want the mysql table data and headers. Is there a wa...

import degree symbol (°) from excel or csv file to mssql database

I have a field in my csv file which contains the text: Frozen at 20°C but when i import into my database it appears as: Frozen at 20�C anyone know how i can keep the correct degree symbol? my import code looks like this string fieldValue = csv[i].Trim(); ...

Resolve path of Excel

Actually I intended to ask the following question: For an executable that lies in a directory defined in %PATH%, how can I find out in which of these directory it is found? because I need to run Excel from C# using Process.Run(...), and just indicating "Excel" works fine: Windows seems to know where to find it. However I need...

Download Data from HTML table to excel

Hi, I have a table, constructed in PHP that displays results from a mysql table. Like so: $sql = mysql_query("SELECT * FROM survey"); echo "<table border='1'> <tr> <th>Question 1</th> <th>Question 2</th> <th>Question 3</th> <th>Question 4</th> <th>Qu...

Open xml SDK Save a template file (.xltx to .xlsx)

I have the following code to open excel template file and save it as .xlsx file and I get the error below when I try to open the new file. Please help to resolve this. Excel cannot open the file ‘sa123.xlsx’ because the file format or the extension is not valid. Verify that the file has not been corrupted and that the file extension mat...

Excel SUM and IF combine help

I have two columns of numbers. Both are 1 to 5. I want to count all the cells where the left column value equals the right column value AND the left column value equals a certain value. I tried this: =SUM(IF(W2:W13=X2:X13 AND W2:W13=4,1,0)) I've tried pressing Ctrl+Shift+Enter and it adds {} around the formula but that didn't hel...

Spreadsheets: how do I SUM values in a column, only if the text coloum has a 1?

lets say I have this data 4 1 4 0 4 1 3 0 5 1 So, How do I write a function (using SUM or somethnig like that) to add all the values on the left, if the values on the right are 1, or true the total should be 13 ...

Downloading and Formatting Web Data with Excel VBA

Hi, I need help creating a VBA macro that downloads closing price data directly from Yahoo Finance's Historic Quotes website and imports the data into an Excel spreadsheet column. Background information: This is the link to Yahoo Finance's Historical Quote database - To download as a TXT file: http://ichart.finance.yahoo.com/table...

Creating excel file with java (invalid file format)

I manage to create Excel 97-2003 file with Java, but when I try to open it with Windows Explorer, I get the error message file format is not valid. The filename is file.xls so it should be right? What goes wrong then? ...