excel-2007

Changing color of Bars in a bar chart

余生颓废 提交于 2019-12-24 08:38:38
问题 I have a code in excel to change colors of bar graph but its not working. Can anyone suggest me what I am doing wrong in the code. With ActiveChart.SeriesCollection(1).Interior.Color = RGB(0, 153, 64) End With This code doesnt affect color of the bar. Also, For all bars (representing values 0 to 200) I want one color (green) but for two bars representing two data points (100 and 200), I want to add different color. Can anyone please tell me how to to that with VBA. I would appreciate your

Merge and Color style not applying in Apache POI excel 2003 format

牧云@^-^@ 提交于 2019-12-24 04:42:06
问题 In Apache POI, I have apply some styles for some cells and merged those cells. When I open in 2010 or 2007 its works fine, but in 2003 the formatting style is gone. It thorws the compatibility check dialog before saving the 2003 excel file each time. Please refer the screen shot. Below is the sample code : ......... style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); style.setFillPattern(CellStyle.SOLID_FOREGROUND); ......... cell.setCellStyle(style); merging the cells

Remove Ribbon from Excel

纵然是瞬间 提交于 2019-12-24 01:04:35
问题 I'm trying to remove the ribbon bar from the Excel window. Currently I'm using the following code which removes the ribbon. excelApp.ExecuteExcel4Macro("SHOW.TOOLBAR(""Ribbon"",False)") But it also removes everything above the cells including the title bar. I need the title bar so users can move, minimize, maximize and close the window. Ideally I would like to remove the entire ribbon but I would be satisfied if I could minimize the Icons on the Ribbon. I can minimize the ribbon icons by

Why does not field with custom function to get name recalculate?

隐身守侯 提交于 2019-12-24 00:15:57
问题 I use a vba function to get cell name (taken from Retrieving Cell name in Excel) Public Function CellName(oCell As Range) As Variant Dim oName As Name For Each oName In ThisWorkbook.Names If oName.RefersToRange.Parent Is oCell.Parent Then If Not Intersect(oCell, oName.RefersToRange) Is Nothing Then CellName = oName.Name Exit Function End If End If Next CellName = CVErr(xlErrNA) End Function When the name of the cell does not exist, it shows error -- and that is of course intended behaviour.

MS Excel LOOKUP from top to bottom column

混江龙づ霸主 提交于 2019-12-23 20:04:28
问题 I have a problem finding a way for LOOKUP to search from top to bottom column. Here's the situation. I need to create a formula for Excel to search for hardware part inside a sentences. Example : Sentence (A1) Customer PC can't turn on. Check motherboard. Motherboard faulty. Replace motherboard. PSU don't have enough power. Replace PSU. Here is lookup range column(HARDWARE) replace PSU replace motherboard result range column(HARDWARE_PART) PSU motherboard The formula I use is LOOKUP(9999

Run-time error '1004' - Method 'Range' of object'_Global' failed

最后都变了- 提交于 2019-12-23 19:35:14
问题 I have a problem in VBA with a line throwing back an error. What the macro is intended to do is find a particular cell then paste data into it. The code is as following: 'To find Column of Customer imput For Each cell In Range("B4:M4") If cell.Value = strLeftMonth Then DataImportColumn = cell.Column End If Next For Each cell In Worksheets("data customer monthly 2013").Range("A3:A9999") 'First Customer If cell.Value = strFirstCustomer Then DataImportRow = cell.Row Range(DataImportColumn &

Excel 2007 from C# get_Value always returns -2146826265

寵の児 提交于 2019-12-23 19:04:48
问题 I have a small C# app that references the Microsoft Excel 12.0 Object Library. Among other things, it reads a value from an Excel cell. It reads this value from some older Excel (.xls) files and some 2007 files (.xlsx). The value comes back properly for all .xls files but I only get the following value for .xlsx files: -2146826265. The cell I'm reading contains a simple formula: "=A1+B1". This is the line of code I'm using ((Excel.Range)ws.Cells.get_Item(29, 17)).get_Value(null)); Where ws is

Excel 2007 VSTO plugin exception when setting Font.Color

会有一股神秘感。 提交于 2019-12-23 18:55:31
问题 I am working on an Excel 2007 VSTO plugin that is throwing COM exceptions on the client but not when debugging on my development machine. What the plugin does is capture Excel's Startup event, define a specialized style, then add an event handler to the SheetChange event. Anytime a value is changed in the sheet, the cell is set to the new style. All of this is to provide users a way to see the cells they've changed. Code is as follows: private void ThisWorkbook_Startup(object sender, System

Spline interpolation in Excel

自作多情 提交于 2019-12-23 18:15:34
问题 I'll make this clear and simple, since I'm on a deadline here. Doing some reports for my section, and I came to a part where I could really use an interpolation in Excel. Now, I've never had any practice with its functions, or VBA in general. So, is there a place where I could, or do anyone of you guys know some, ... where I could pick up a simple spline interpolation along with a tutorial of "how to make it work" (literally, I have no idea - I use Excel on a one-handful-of-times-on-an-annual

Formatting csv files in Excel

旧城冷巷雨未停 提交于 2019-12-23 15:52:35
问题 Win XP, Excel 2007 I know there are various other posts on csv formatting but couldn't quite find what i needed. Some of our data is held off site by another company and they send us a csv file every morning with the previous days data. The problem is this data has come from web input forms that may have drop-down lists. For example there may be a drop down list of Number of Employees with options like 1-10, 11-25, 26-50 etc When we open the csv file in Excel certain options like 1-10 has