+ Reply to Thread
Results 1 to 6 of 6

Porblem Emailing Exce templates

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Porblem Emailing Exce templates

    I have created excel templates and am sending them out to the clients via email. When they receive them they have to enable contents and the auto_open macro stops with an error 91 variable not found on the following line

    ActiveSheet.Unprotect Password:="test"

    They need to send out these templates to their sales rep and will probably encounter the same problem

    Would anyone have come across this previously

    Thanks

    Regards

    Carmel

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Porblem Emailing Exce templates

    The error is actually "Obect variable not found" which, in this case, means that at this point there is no activesheet. So it maybe worth looking at moving the code to an event that occurs later. Maybe the sheet activate method.

    error 91 OBJECT variable not found

    ActiveSheet.Unprotect Password:="test"


    click on the * Add Reputation if this was useful or entertaining.

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Problem Emailing Excel templates

    Hi, Carmel,

    the Auto_Open-macros from the standard modules have been replaced by the Workbook_Open-event in ThisWorkbook from Excel97 on.

    Maybe make sure that the ActiveSheet is a worksheet and is protected and then run the code like
    Please Login or Register  to view this content.
    I would work around that indicating the codename for the sheet and replace ActiveSheet with that name (i.e. Sheet1).

    Depending on what needs to do done with the sheet I wonder why you need to protect a sheet and send it to somebody who can unprotect it and hand it out. I would prefer to protect the sheet with the volatile setting of using UserInterfaceOnly:=True allowing macros to work on the sheet but not manual entries.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    03-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Porblem Emailing Exce templates

    Thanks Tony that helped

  5. #5
    Registered User
    Join Date
    03-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Problem Emailing Excel templates

    Thanks Holger

    I had not realised that the Auto open had been replaced that will be very useful to know in the future

    Carmel

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Porblem Emailing Exce templates

    Hi, chexcel,

    do you mind changing the thread to Solved via Thread Tools above the first post if the issue has been resolved?

    Ciao,
    Holger

+ 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. Timer In exce;
    By excel_student_98 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2013, 01:02 AM
  2. Hello Exce Forum
    By snapfade in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 10-08-2012, 07:07 PM
  3. Time formula,comma and formatting porblem
    By blindexcel in forum Excel General
    Replies: 2
    Last Post: 04-06-2011, 06:02 PM
  4. Latitude/Longitude Porblem
    By edwardtong694 in forum Excel General
    Replies: 3
    Last Post: 05-20-2009, 12:23 PM
  5. Replies: 0
    Last Post: 01-05-2006, 06:50 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