+ Reply to Thread
Results 1 to 3 of 3

First timer command button link - compile error expected end sub

  1. #1
    Registered User
    Join Date
    05-25-2012
    Location
    CAPE TOWN, SOUTH AFRICA
    MS-Off Ver
    Excel 2010
    Posts
    2

    First timer command button link - compile error expected end sub

    VB,
    COMMAND BUTTON,
    PRINT ACTIVE SHEET TO PDF,
    ADD NAME TO PDF FROM SPECIFIC CELL,
    OPEN OUTLOOK 2010 NEW EMAIL,
    ADD EMAIL ADDRESS FROM SPECIFIC CELL,
    ADD PDF TO EMAIL AS ATTACHEMENT,
    STOP SO THAT EMAIL CAN BE SENT AFTER REVIEW OF PDF ATTACHEMENT

    Hi Everyone
    If anyone can help me to streamline the above, I would appreciated it.
    I copied the code from another VB programmer, but when I linked it to the command button, I get the error message.
    Error Message.jpg

    Here is the code where the error occurs.
    Code.jpg

    This is my first VB attempt, so I might have bit off more than I could chew!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: First timer command button link - compile error expected end sub

    If you check at the top of your code, you can have 2 statements

    1. Private sub....
    2. Sub RDB_workbook....

    Remove the 2nd line, then the error will stop.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    05-25-2012
    Location
    CAPE TOWN, SOUTH AFRICA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: First timer command button link - compile error expected end sub

    Thanks! All good!

+ 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