+ Reply to Thread
Results 1 to 5 of 5

VBA not working when assigned to a text box

  1. #1
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    VBA not working when assigned to a text box

    So I have some VBA that when I run it in the module it works great. It attaches the workbook to the email and everything but when I assign it to a text box it only creates an email but does not attach the current workbook. Where am I going wrong?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA not working when assigned to a text box

    How are you trying to trigger the code from the textbox?

    If it's a Forms textbox on a sheet you would need to actually click the textbox.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: VBA not working when assigned to a text box

    Sorry forgot to add the code. I created a box using: insert > Shapes > Rectangle and added text to it. The box will open up an email with the "To" and "Subject" but it wont attach. if I run the code in the module it will attach.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA not working when assigned to a text box

    What happens if you remove On Error Resume Next from the code and run it again?

  5. #5
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: VBA not working when assigned to a text box

    Well now I feel kind of dumb. So there are a couple other text boxes and the one I was using was a copy and it had a hyperlink so once I right clicked on the box and removed hyperlink the VBA worked great. Sorry and Thanks!

+ 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. picking a text field assigned from min/max value
    By owenfoote in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-05-2015, 01:34 PM
  2. Assigned Macros don't stay assigned?!?
    By paesu57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2014, 10:49 AM
  3. [SOLVED] Multiply with value-assigned-text in a drop box
    By EWV in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2013, 04:36 PM
  4. Drop Down Lists - Values assigned to Text
    By Traviscon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-19-2012, 02:12 PM
  5. Replies: 2
    Last Post: 10-25-2006, 11:45 PM
  6. [SOLVED] Substitute text with assigned values
    By TD in forum Excel General
    Replies: 2
    Last Post: 07-07-2006, 05:35 PM
  7. Disappearance of assigned value of varaible when working with form
    By vbaprog in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-19-2005, 08:06 PM

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