+ Reply to Thread
Results 1 to 5 of 5

Issue with Setting target font name

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Issue with Setting target font name

    With Excel 2000, I had written a double click code that included the following code snippet
    Please Login or Register  to view this content.
    With Excel 2010, I get the following error "Runtime error 1004. Unable to set the name property of the font class" and it debugs to the font.name line. It correctly puts in the value. Can I no longer directly assign the font from target within an event macro? Thanks in advance.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Issue with Setting target font name

    Hi Chemist,

    Running 2010 I have no trouble changing the font using

    Please Login or Register  to view this content.
    Are you sure Target is a valid range object (not protected or anything like that)? What if you debug, can you change the Font in the immediate window without errors?
    If you like my contribution click the star icon!

  3. #3
    Forum Contributor dogberry's Avatar
    Join Date
    07-15-2012
    Location
    Wales, UK
    MS-Off Ver
    Excel 2010
    Posts
    624

    Re: Issue with Setting target font name

    http://chandoo.org/forums/topic/font...ill-not-change

    Hi

    Dont know if its a waste of time but look at the above link perhaps a change in syntax will solve your problem.


    Chris
    Click my star if I helped Thanks

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Issue with Setting target font name

    @ChemistB,

    Just a thought, do you still trigger this code from a double click? I have noticed that Excel sometime can't do something to a cell object when the cursor is actually inside the cell (inline text editing). Any chance of that being the case?
    Last edited by jeffreybrown; 12-28-2012 at 10:31 AM. Reason: Please limit quoting to only that which is neccesary...it just causes thread clutter...Thanks.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Issue with Setting target font name

    Dogberry, I will check that link.
    Olaf, yes, I am using double click to trigger the event. I'll try other triggers to see if it makes a difference.
    Thanks to both.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1