excel-2007

add decimal as time

is there anyway to add a group of decimal numbers and excel treat it as time? example; 15.00 = 15 hours 1.00 = 1 hour .20 = 20 minutes .45 = 45 minutes .15 = 15 minutes excel adds this to 16.80, but if you want it as time the answer would be 17.15 17 hours 15 minutes ...

Read specific Coloumns from Excel files with C#

I wanna to read some excel files and convert to my own excel template.I want to read B coloumn every line.(B1,B2,B3... going like this.) If there is a number in this coloumn ; in B3 there is number like "1,2,3,4,5,6,7,8,9"than i ll get this whole line and take it to an array[i].If there is "5" number in B4 than it ll get this whole line...

excel: charting with unknown number of data

Let's (for discussion purposes) say that I have x and y data in 2 columns. They're some measured data which, several times a day, a few of them are added (usually 4 times a day). Now, I wish to plot y=f(x) (linear scale), but the problem is since data is constantly added to determine the number of points which will go in the plot. Always...

Where should I post my python code?

Today I needed to parse some data out from an xlsx file (Office open XML Spreadsheet). I could have just opened the files in openoffice and exported to csv. However I will need to reimport data from this spreadsheet later, and I wanted to eliminate the manual operation. I searched on the net for xlsx parser, and all I found was a stacko...

Setting a cell's format using Excel 2007 Interop and C#

I'm using the office 2007 interop assemblies to create some excel spreadsheets. There are plenty of questions on here about getting started and MSDN contains heaps of articles, like this one. The API is funky, and sometimes a bit confusing. When I set a value of a cell, is there a way to set it's format? I'd like to mark particular f...

Numeric precision issue in Excel 2007 when saving as XML

I am encountering a strange issue when saving documents in XML Spreadsheet 2003 format using Excel 2007. It seems to randomly change numeric values such as "0.58" to "0.57999999999999996". What's really odd is that you CANNOT see this issue when you are in Excel. You can only see this when viewing the XML data directly from a text edi...

User Defined Functions in Automation Addin behave differently Excel 2007

I have created an automation addin in C# .NET and have a shim dll for it. The shim dll has all the User Defined methods in it that calls the appropriate methods in the .NET assembly. The problem that I am facing is related to Excel 2007. In Excel 2003, 1. Add a new shape to a worksheet 2. Insert >> Function >> SUM. The Function argum...

How do I use a parameter in an Excel external data request?

I can already use Excel (2007) to import data from SQL Server 2005. I add a data connection and I enter a custom SQL query that retrieves my desired data. Cool. But what I'd like to add is the ability to parameterize that query based on a value found in a known cell on the spreadsheet. My query would go from SELECT * FROM dbo.MyDataTa...

How to get Last Active Cell in Excel 2007

I am working with C++ unmanaged and Excel 2007. I am using a call to the Excel4 API to get the range of cells selected by the user. When the user selects what I call a "common" range, this call returns a range like this "R1C1:R4C3", which is exactly the format that I need for doing other operations in my application. However, when the ...

How can I automate the creation of named references in Excel? I want the first field of every row to be my reference.

The first column of my spreadsheet is a unique key (data wise, nothing to do with excel). Another of my columns contains links to other rows (to that row's unique key). When I insert these hyperlinks, I need to point to "defined names" since the row order will change over time. I don't want to have to create the defined name every ...

How do you create an Excel worksheet through VB6 without the Excel Object?

I was recently put in charge of updating a VB6 data collection app, to add the ability to generate Excel reports and print them through the app (both have to be done on same computer). Normally this wouldn't be an issue, I've generated Excel reports with VB6 before using the Excel Object. So I went ahead and coded together the changes a...

SQL Query Run Against Excel Workbook Returns Truncated Text Field

Hello - I'm running a SQL SELECT query through an ADO connection to an Excel 2007 workbook with the following code (using a custom version of VBScript) dim ado, rs set ado = CreateObject("ADODB.Connection") ado.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=workbook.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES;IM...

Showing caption for CommandBar button with Excel VBA

I'm trying to add a button to a new CommandBar (for the Add-in tab) with Excel VBA. I can get the button into the ribbon and can get an image to show up for it if I use a FaceId, but I can't get the Caption to appear. Is there some way to do this? Do i have to use an image instead? With Application.CommandBars.Add("Open Forms") Wi...

Performance running ClearContents is very slow when WrapText is enabled in Excel

I'm debugging the following code in an Excel 2007 VBA, which seems very simple. For some reason its taking about 30 minutes to process 900 rows of data. I think I have narrowed it down to some cell formatting, specifically the WrapText option. Is there something I'm missing here that can increase the performance when deleting these ro...

Exception automating Excel 2007 with Powershell when calling Workbooks.Add()

The following code throws an exception in Powershell V1 (Excel 2007): $E = New-Object -COM "Excel.Application" $E.Visible = $True $wb = $E.Workbooks.Add() #<<<Exception here The error says that the format might be old or that the type library is not valid (translated from Spanish). A similar script for Word works just fine. ...

Where are all the places that VBA macros for Excel 2007 can be turned off?

Macros refuse to run for me in Excel 2007 on Windows Server 2003. The macro and visual basic icons on the ribbon are grayed out. If I open a workbook with a macro, I get the warning: " This workbook has lost its VBA project, ActiveX controls and any other programmability-related features." If I try to make a new excel template in VSTO (E...

Format Excel Chart Background using C#

I can already populate the data into the spreadsheet, create the chart based on the range I select. However, when it comes to formatting the actual chart I feel a bit lost as their are so many options!! It is an xlCylinderBarStacked type chart. I simply need to make the color of the bars a nice light orange and make the background a lig...

Excel VBA copy XL-2007 Macro-Enabled Workbook as excel-2003 file with no macros

I''m looking for a vba macro that will make a copy of the current Excel 2007 macro-enabled workbook with the name I specify as an Excel 2003 macro-free document. It should also keep the current workbook open and in the Excel 2007 format (so save-as wouldn't work). I can't figure out how to do the copy operation... ...

Excel 2007 question about random numbers

Hello Experts In cell A1:A50 i have random numbers geberated by formula ( from 0 to 20), now what ever i do these numbers keeps on changing all the time, so i want to know the formula which will shuffle these random numbers automaticallly till the series whcich have got 5-12-19 in a row will appear. I would really appriciate if some one ...

run time error '9' Subscript out of range

hello, i am trying to run a solver optimisation through vba 6 excel. but when the execution reaches the declaration of the objective function: Sheets(working).Range("B63").FormulaArray = _ "=MMULT(MMULT(decision,covarMatrix),TRANSPOSE(decision))" it gives the following message "run time error '9' Subscript out of range" ...