2003 to 2007 Macro Issues

abyss478

New Member
Joined
Jul 9, 2009
Messages
3
Hi guys,

I'm having trouble with a macro used in 2003 but refuses to run in 2007. It's an old program, and to be honest I'm not real great with VBA. I've searched and searched for hours and simply cannot find any information on how to fix my problem. I was hoping you guys could shed some light on the matter...

Here's the code I'm working with:

If NumCharts% <= 1 Then
With .TextBoxes.Add(0, 0, 0, 0)
.AutoSize = True
.Formula = "=" + TheSource$ + RowCol$(21, ColSource%)
.Formula = "=" + TheSource$ + RowCol$(21, ColSource%)
End With
With .TextBoxes.Add(0, 15, 0, 0)
.AutoSize = True
.Formula = "=" + TheSource$ + RowCol$(22, ColSource%)
End With
With .TextBoxes.Add(0, H& - 25, 0, 0)
.AutoSize = True
.Formula = "=" + TheSource$ + RowCol$(20, ColSource%)
End With
End If


I didn't write this code, it was handed down to me. The issue arises when the ".Formula" line is ran. I am given an error message "Run-time error '1004': Unable to set the Formula property of the TextBox class"

Do you guys see any issues with the above code? Again, this works in 2003 but not 2007. ANY help at all would be GREATLY GREATLY appreciated. I've spent countless hours trying to fix this issue to no avail.

Thanks in advance.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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