+ Reply to Thread
Results 1 to 7 of 7

AddTextbox Method Powerpoint Set or NotSet

  1. #1
    Registered User
    Join Date
    08-29-2014
    Location
    Berlin, Germany
    MS-Off Ver
    2007
    Posts
    9

    AddTextbox Method Powerpoint Set or NotSet

    Hi everbody

    Im trying to create a textbox using the addtextbox method. my book ("Mastering vba micr. off. 2010") is suggesting the following:

    Please Login or Register  to view this content.
    This doesn't work. But when I use the method without setting an object it works.

    Do you have any ideas why?

    note that im using office 2007.

    Thanks for your time and help!

    -Jon
    Last edited by Jonas1503; 09-11-2014 at 11:49 AM.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: AddTextbox Method Powerpoint Set or NotSet

    Hi Jonas,

    You're going to hate yourself for this one. The item in red below seemed to be missing. When I got it working the Shape was not in the visible area of my slide.

    Please Login or Register  to view this content.
    The following is text that I use for a shape:
    Please Login or Register  to view this content.
    You can avoid the error you had using 'Option Explicit'. To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    Lewis

  3. #3
    Registered User
    Join Date
    08-29-2014
    Location
    Berlin, Germany
    MS-Off Ver
    2007
    Posts
    9

    Re: AddTextbox Method Powerpoint Set or NotSet

    hey lewis,

    thanks! but unfortunately the misspelling is not the reason. I still get an "activex component cant create object"..... any other ideas whats going on? (I also tried your code and it gives the same error).

    Thanks for your time!

    Jon

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: AddTextbox Method Powerpoint Set or NotSet

    Hi Jon,

    My speculation is that you are missing one or more VBA resources. To see what resources you have enabled, in PowerPoint, access VBA and select: Tools > References. The references enabled on my computer are in the attached jpg file. Your version numbers (e.g. Office 11.0) will probably be a higher number because you have a later version of Microsoft Office.

    If you are missing a reference or references, check the box for the appropriate reference.

    If this doesn't fix the problem, I am stuck.

    Lewis
    Attached Images Attached Images

  5. #5
    Registered User
    Join Date
    08-29-2014
    Location
    Berlin, Germany
    MS-Off Ver
    2007
    Posts
    9

    Re: AddTextbox Method Powerpoint Set or NotSet

    I think I have all the necessary references.....maybe it has something to to with me running the code from vba embedded in excel, although Im am really careful referencing active apps, active windows etc.

    maybe the complete code is helpful:

    Please Login or Register  to view this content.
    Same problem: method as it is works (AddtextBox(......).Select for example) but setting a shape obj with the method does not!

    Thanks!

  6. #6
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: AddTextbox Method Powerpoint Set or NotSet

    Hi Jon,

    Excel and PowerPoint apparently don't recognize each other's objects such as 'PowerPoint.Application'. I got your code to work when I changed all objects to the generic 'Object'. Please note that the 'BLABLA' text is off the slide on my computer and in order to see it, I had to reduce zoom to 50% or 75%.

    Try (changes in Red):
    Please Login or Register  to view this content.
    Lewis

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: AddTextbox Method Powerpoint Set or NotSet

    if you have a reference set to the powerpoint object library you can declare variables as powerpoint.application. your textbox variable needs to be declared as
    Please Login or Register  to view this content.
    I reckon
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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. PowerPoint interop without showing the PowerPoint application window
    By philippjb0 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2013, 06:36 AM
  2. Replies: 13
    Last Post: 01-11-2013, 04:46 PM
  3. Data input in powerpoint to select data in excel and report back to powerpoint
    By daveybright in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2009, 09:54 PM
  4. AddTextBox
    By koticphreak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2008, 10:41 PM
  5. [SOLVED] parameters AddTextbox
    By piet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2005, 10:05 AM

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