My VBA code does not work in Office 2007

hamohd70

New Member
Joined
Sep 21, 2016
Messages
35
I developed and tested some VBA code using Office 2013 and was working perfectly. BUT when I ran it on Office 2007, the code breaks at this line...

Code:
ActiveSheet.Range("D6").Value = "=" & Worksheets("Formula").Range("AlarmsStatusFormula").Value

the error msg I received was Run-time error 1004: Application-defined or object-defined error.

Can you please help with this?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
What is in the AlarmsStatusFormula cell? Does it involve any functions introduced after 2007 perhaps?
 
Last edited:
Upvote 0
Was this saved in an Excel version later than 2007? If so then an add-in for the later version will be missing from 2007.
 
Upvote 0
What is in the AlarmsStatusFormula cell? Does it involve any functions introduced after 2007 perhaps?

AlarmStatusFormula contains this formula
Code:
IF(OR(ISNUMBER(SEARCH({"Recover"," NR"},[Message]))),"FOUND","")
 
Upvote 0
Is D6 part of a table that includes a column called Message?
 
Upvote 0
That should really be an array formula though, unless you meant to refer to that column in the same row?
 
Upvote 0
That should really be an array formula though, unless you meant to refer to that column in the same row?

It is an array formula. what I'm try to do is looking for "Recover" or " NR" in the column "Message" and then update D6 with "Found" or just leave it empty.

The named range "AlarmsStatusFormula" has the formula that will do the work for me.

Can it be something to do with the way Excel 2007 handles named ranges vs 2013?
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top