+ Reply to Thread
Results 1 to 7 of 7

Trying to change text in an autoshape but i get an error. Any ideas

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    england
    MS-Off Ver
    Excel 2003, 2007
    Posts
    3

    Trying to change text in an autoshape but i get an error. Any ideas

    Hi,I'm new to the forum. I am trying to change text in an autoshape in vba but i get an error. Any ideas. Code below

    [/Dim c
    c = Application.Caller

    With ActiveSheet.Shapes(c)
    .OLEFormat.Object.Characters.Text = "Form complete!"
    .Fill.ForeColor.SchemeColor = 17
    .Fill.Transparency = 0#
    .Line.Weight = 2#
    .Line.DashStyle = msoLineSolid
    .Line.Style = msoLineSingle
    .Line.Transparency = 0#
    .Line.Visible = msoTrue
    .Line.ForeColor.SchemeColor = 1
    End With\]
    Last edited by Jats; 09-30-2013 at 10:41 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Trying to change text in an autoshape but i get an error. Any ideas

    I'm not sure the .characters bit is needed, have you tried:
    .OLEFormat.Object.Text = "Form complete!"

  3. #3
    Registered User
    Join Date
    01-17-2013
    Location
    england
    MS-Off Ver
    Excel 2003, 2007
    Posts
    3

    Re: Trying to change text in an autoshape but i get an error. Any ideas

    Hi, still doesn't work. I am using xlsb. do you think this maybe the reson. all my other macros are running fine in the file.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Trying to change text in an autoshape but i get an error. Any ideas

    This worked for me:-
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Trying to change text in an autoshape but i get an error. Any ideas

    It seemed to work on the example I tried. I'd guess maybe the issue is with the c variable. What is the value of application.caller, does activeshape(c) refer to something sensible?

    Might be helpful if you could upload an example workbook.

  6. #6
    Registered User
    Join Date
    01-17-2013
    Location
    england
    MS-Off Ver
    Excel 2003, 2007
    Posts
    3

    Re: Trying to change text in an autoshape but i get an error. Any ideas

    Hi, i have tried it in .xls and it work fine but not in .xlsb. Is applicatio_caller not supported in .xlsb?

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Trying to change text in an autoshape but i get an error. Any ideas

    What error do you have? xlsb or xls should work the same. Perhaps you can provide a workbook?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Change Font Colour in Autoshape
    By Tellm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2010, 12:27 AM
  2. [SOLVED] How do I change the autoshape size from inches to cm
    By Francois in forum Excel General
    Replies: 2
    Last Post: 08-12-2006, 11:30 AM
  3. change autoshape by condition from a cell value
    By emil.roman@gmail.com in forum Excel General
    Replies: 7
    Last Post: 04-26-2006, 08:50 PM
  4. [SOLVED] How to change line spacing within an autoshape?
    By pjk1228 in forum Excel General
    Replies: 0
    Last Post: 01-31-2006, 02:30 PM
  5. Change AutoShape Text Color in VBA?
    By TheRobsterUK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2005, 08:35 PM

Tags for this Thread

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