Home > excel > Invalid procedure call or argument applying Excel conditional formatting from Access vba

Invalid procedure call or argument applying Excel conditional formatting from Access vba

January 12Hits:2
Advertisement

I have read numerous examples where this code works; however, when I try to execute it, it isn't working and I don't see why.

Dim xl As Object Set xl = CreateObject("Excel.Application") xl.Range("G2:G375").FormatConditions.Add Type:=xlExpression, Formula1:="=OR(G2=""New"",G2=""Reintroduced"")" 

I get a Run-time error '5': Invalid procedure call or argument. Have tried it by defining activesheet, worksheet name, active workbook, etc. and still get this same error. Everything I have read says it should work, but again, it isn't.

Also, there is data in the spreadsheet that is opened else where in the code.

Related Articles

  • Invalid procedure call or argument applying Excel conditional formatting from Access vbaJanuary 12

    I have read numerous examples where this code works; however, when I try to execute it, it isn't working and I don't see why. Dim xl As Object Set xl = CreateObject("Excel.Application") xl.Range("G2:G375").FormatConditions.Add Type:=xl

  • Exporting excel sheet as PDF Run-time error '5': Invalid procedure call or argumentFebruary 16

    I have a crucial problem with exporting one excel sheet in a workbook into a PDF file. I tried almost everything and went through a lot of google pages to fix that with no results. Sub ExportPDF() Dim Nazwa As String ' Creating a destination folder f

  • Excel Conditional Formatting Multiple Data Bars and Data Icons in one cell

    Excel Conditional Formatting Multiple Data Bars and Data Icons in one cellJuly 7

    I am using Excel 2007 on a windows machine. I am attempting to place one data bar and one data icon into a cell under the conditional formatting. The issue is that I don't really want to have data icons or data bars for cells that have dates in the f

  • Excel: Conditional formatting using icon sets?

    Excel: Conditional formatting using icon sets?May 3

    I would like to format the Subtotal row such that within each Subtotal cell is the total and an "icon set" icon that will show if that month is greater than or less than the previous month's total. I tried the following conditional formatting ru

  • Excel: Conditional formatting for column mergeMay 5

    I'm looking to create a timetable that is formed by combining material from several worksheets. It does not seem to be possible to automatically consolidate text from several worksheets, but it is, of course, possible to manually place all the materi

  • Excel conditionally format a row based on a cellAugust 20

    I have a table something like this: text1A | text2A | value1A | text3A | value2A text1B | text2B | value1B | text3B | value2B text1C | text2C | value1C | text3C | value2C If the value in column 3 is larger than the previous value, I would like the wh

  • Excel: Conditional formatting not filling in cells if adjacent cell is filled

    Excel: Conditional formatting not filling in cells if adjacent cell is filledMay 29

    I am trying to fill a pair of cells in if both are blank. Which works unless the cell next to the pair is filled in. How do I go about resolving this issue? Formula: =AND(ISBLANK(F2),ISBLANK(G2)) Applies to : =$F$2:$G$4 --------------Solutions-------

  • Excel Conditional Formatting Pivot and non pivot rangeFebruary 12

    I'm having a bit of a nightmare with conditional formatting a range which includes a pivot table and a section of non pivot table area. What I'm finding is that refreshing the pivot table deletes the conditional formatting on the portion within the p

  • Excel conditional formatting only applies to first cellOctober 2

    In excel 2010 I have a row of content for which I want to define a conditional formatting. So I select the row, say from B3 to K3, and setup a new rule as follows: Use a formula to determine wihc cells to format Rule: =NOT(ISBLANK(J3)) Format: Colore

  • Excel - conditional formatting in Shapes?

    Excel - conditional formatting in Shapes?September 16

    For a long time, I didn't think it was possible to have a Shape (e.g., Text Box) have a value set by formula, but it turns out you can. Similarly, it appears that you can't apply conditional formatting to Shapes (the option is grayed out in the Ribbo

  • Excel Conditional Formatting Offset Greater than

    Excel Conditional Formatting Offset Greater thanAugust 5

    I need to create a conditional formatting rule that will apply some color if the cell to the left has a value greater than 500, however it is not accepting my formula: =OFFSET(0,-1) > 500 Can anyone tell me what am I doing wrong? --------------Soluti

  • Excel conditional formatting of rowAugust 4

    Can someone please tell me how to highlight multiple cells in a row based on some values in any one of a given number of cells? For example, if in Row 2 any of the cells from D2 to L2 have value "A" or "B" or "C" then I want

  • Excel Conditional Formatting of Rows based on multiple columnsDecember 22

    I have a spreadsheet with columns A-K and rows 1-56. If any value in D3 through J3 goes below 0, I want the entire row (A through K ) to have a special format. I've gotten close in Excel 2010 by using the Home ->Conditional Formatting->Manage Rules-

  • Excel: conditionally format a cell using the format of another, content-matching cell

    Excel: conditionally format a cell using the format of another, content-matching cellSeptember 11

    I have an Excel spreadsheet where I'd like to be able to create a "key" of formatted cells with unique values, and then in another sheet format cells using the key formatting. So for example, my key is as follows, with one value per cell and the

  • Excel conditional formatting fragmentation

    Excel conditional formatting fragmentationMay 22

    Often, I create a sheet with conditional formatting, and set the cell ranges so that the conditional formatting rules are only applied once to a range of cells, e.g. Make $A$1:$A$30 red and Make $B$1:$B$30 blue. After inserting/deleting a number of r

  • Excel conditional formatting if value is between or equal to values

    Excel conditional formatting if value is between or equal to valuesSeptember 9

    I have been trying to use conditional formatting to create a Gantt chart. So far I have not been very successful. Here is a screenshot of part of the chart: The current formatting is hand made. I want the cell to turn pink if it meets the following c

  • Excel - Conditional formatting retention through data validation in another sheetJuly 24

    I have applied conditional formatting in an Excel sheet (Sheet2) to change the font color in column A if the result in the adjacent cell in column B is "No." I then used this conditionally formatted range in column A, Sheet2 to populate a dropdo

  • Excel Conditional Formatting for Date colums

    Excel Conditional Formatting for Date columsNovember 16

    I have 2 columns with dates and I want to apply conditional formatting to all values where the date in one column is bigger than the date in the other column. So, when the dates in "Actual End Date" are greater than the dates in "Requested

  • Excel Conditional formatting if in listDecember 8

    I have a list of values J1:J100 and another list of values E1:E75 If a cell in column J matches a cell in column E, I would like this cell to be highlighted. Any ideas what formula to enter into the conditional formatting prompt for Excel? I'm not to

  • Excel Conditional Formatting Escaping a Question MarkMay 24

    I would like to use a conditional formatting rule in an excel file that would color any box with a question mark in it red. It seems that Excel is using a question mark as a wild card and will turn all cells with at least one character in them red. H

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.485 s.