Sudden issue with: DrawingObject.Formula = ""

woodnathan

New Member
Joined
Oct 25, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
We have several spreadsheets that use VBA to assign a named range to a shape. Basically, another macro draws a picture inside a range named "CS". Then, the chunk of code below assigns the named range to the shape. A picture of the range will show in the shape. This has worked forever. In fact, it still works on my computer. But on my coworkers machine, it has suddenly started kicking out a '1004' error when it tries to set the DrawingObject.Formula = "".

I've checked it on other computers in the office and it works on theirs.

If I select the shape and type =CS into the formula bar, I don't get an error, but the picture doesn't update anymore.

If I select the shape and delete what is in the formula bar, (setting the formula value to ""), I get an error.

Again, this works on everyone else's computer. I've tried every setting in Options I can think of and checked references, but I'm stumped.

Figured I'd take it to the masses.

Offending chunk of code:

--------------------------

Private Sub Worksheet_Activate()

Sheets("Macro References").Range("A5").Value = 0

Sheets("Input").Shapes("CS_View").DrawingObject.Formula = "=CS"

End Sub

--------------------------

Private Sub Worksheet_Deactivate()

Sheets("Input").Shapes("CS_View").DrawingObject.Formula = ""

End Sub
 
Let me be clear, this macro fully functions on mine and others machines. The code has been written for years and has worked flawlessly for as long. Until Monday of this week, did the co worker having the issue was able to run this code.

Could this possibly be a permission issue for the files on the network drive?
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Manual deletion of the formula in the Formla Bar is also not possible, so I suspect that the error is not in the code, but in a changed basic setting of Excel - but I cannot find a solution.
 
Upvote 0
A formula that belongs to a graphic can no longer be deleted manually - how can this be remedied?
 
Upvote 0
Does the same thing happen when using a brand new workbook?

If not, maybe the workbook itself is corrupt. In this case, try repairing it...


If the same thing happens in a new workbook, try repairing Office 365...


Hope this helps!
 
Upvote 0
If you don't have that same problem with a brand new workbook, then it's likely that the workbook is corrupt beyond repair...
 
Upvote 0
1698589784132.png

I can change the fomrel =$A$1 zar but not remove it.
 
Upvote 0

Forum statistics

Threads
1,223,262
Messages
6,171,080
Members
452,377
Latest member
bradfordsam

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