Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,004
    Thanks
    63
    Thanked 2 Times in 2 Posts

    Macro Security Issue

    When trying to activate any of the macro on the attached workbook I get a message regarding macro security (has also attached screen print of message)

    I have look at my macro security settings and cannot resolve the problem

    I think the problem may be do to with the macro "Delete_Next_period"

    It would be appreciated if someone can assist me
    Attached Files Attached Files
    Last edited by HowardC; 2014-07-23 at 23:13.

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,058
    Thanks
    196
    Thanked 765 Times in 699 Posts
    Howard,

    You have a bunch of errors in the code as posted.

    There is no While ... Wend in VBA it is Do While ... Loop

    You need to use the compile option of the VBE menubar and fix all the problems it finds before we can give you help as at least for myself I'm not sure what the code is trying to do in it's current state. HTH

    BTW: I didn't get any security warnings.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  4. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,206
    Thanks
    14
    Thanked 331 Times in 324 Posts
    That warning has nothing to do with the code, it has to do with the your security settings. See the article at http://office.microsoft.com/en-us/ex...010096919.aspx

    Steve

  5. #4
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,004
    Thanks
    63
    Thanked 2 Times in 2 Posts
    Thanks for the reply

    I have filtered data that is imported on sheet "Data". I manually filter the data for a specific month number in Col O for Eg 10 and then delete these rows. I then refilter the data to select All.


    I would like the macro "delete_next_period" to automate this

    BTW if I remove this macro then there is no security issue. I can run macros on any of my other workbooks

    Your assistance in resolving this is most appreciated

  6. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,873
    Thanks
    0
    Thanked 79 Times in 75 Posts
    Quote Originally Posted by RetiredGeek View Post
    There is no While ... Wend in VBA it is Do While ... Loop
    That's not correct. While...Wend is perfectly valid in VBA, if a little old-fashioned.
    Regards,
    Rory
    Microsoft MVP - Excel.

  7. #6
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,058
    Thanks
    196
    Thanked 765 Times in 699 Posts
    Rory,

    OOPS! My Bad.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  8. #7
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,004
    Thanks
    63
    Thanked 2 Times in 2 Posts
    Hi RG & Steve

    It would be appreciated if one of you can assist me in getting the macro "Delete_next_period" to work. If I delete this macro, then the other macros in the workbook can be run

    Howard

  9. #8
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,206
    Thanks
    14
    Thanked 331 Times in 324 Posts
    The workbook attached has no macros in it...

    What do you want the macro to do? If we know that we don't need to see what you originally had anyway...

    Steve

  10. #9
    5 Star Lounger
    Join Date
    Feb 2008
    Posts
    1,004
    Thanks
    63
    Thanked 2 Times in 2 Posts
    Hi Steve

    My apologies. I must have deleted the macro in error

    I managed to sort out an error in my code.

    In my code I had


    Code:
     Sheets("Data").Select
    Range("AA1").Select
    InputBox = ("select period to delete for eg 12")
    Instead of

    Code:
     Sheets("Data").Select
    Range("AA1").Select
    ActiveCell.FormulaR1C1 = InputBox("select period to delete for eg 12")

    I have filtered data that is imported on sheet "Data". I manually filter the data for a specific month number in Col O for Eg 10 and then delete these rows. I then refilter the data to select All.


    Code is now working perfectly

    Howard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •