Results 1 to 5 of 5

Receiving "enable content" warning after executing "save as" code

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Receiving "enable content" warning after executing "save as" code

    I have this code:

    ActiveWorkbook.Sheets(1).Select
    ActiveSheet.Copy
        
        ActiveSheet.Protect Password = "report"
        ActiveWorkbook.SaveAs "S:\Production reports\" & Replace(Range("G3").Value, "/", "-") & "-" & Range("G5").Value, _
            FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
        
        ActiveWindow.Close
    The code automatically saves a report from the active workbook i am using in the correct location and file name i desire.
    However, i am having some issues.

    1) the password is not working. The resultant file IS password protected, but the password does not work to unlock it
    2) the resultant file opens with an "Enable Content" message followed by "Trust files like these." I assume this is because the original file i am working with contains macros. I do not need macros in the resultant file, and i am worried these "warnings" will confuse people i have to email this report to.
    Last edited by phbryan; 11-11-2014 at 10:52 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Password code designed for 5 Users - NAVIGATION Help Needed! - CODE Issue!
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-09-2014, 10:46 AM
  2. [SOLVED] Excel VB code. Message pops up while code running asking question. Code must not wait.
    By Heinrich Venter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-28-2014, 06:10 AM
  3. [SOLVED] VBA code for assigning a numeric code to text; then numeric code populates table
    By cteaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2014, 08:01 PM
  4. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  5. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM

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