View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Martin Brown Martin Brown is offline
external usenet poster
 
Posts: 230
Default vba in excel 2007

On 24/05/2012 07:18, joeu2004 wrote:
"blueflash" wrote:
I have a vba program written in excel 2003 and am trying
to get it to run in excel 2007. The program gives a runtime
error 5 "Invalid procedure call or argument" at the statement
Selection.Characters(Start:=2, Length:=5).Font.Name = "Arial"
Could someone tell me how to correct this please.


Works fine for me. You have some other error.

First, did you copy-and-paste that statement from the XL2007 macro into
your posting?

If not, you might unconsciously fixed whatever syntax error your have in
the XL2007 macro.

Second, is Selection another object, for example a chart, not a cell?

Third, is the Arial font available in your XL2007?


Mostly likely cause is whatever he has selected at the time doesn't like
the requested action. XL2007 VBA is seriously incompatible with XL2003
where shapes and graphs are concerned. And the macro recorder is so
hopelessly broken that it might as well not exist.

--
Regards,
Martin Brown