+ Reply to Thread
Results 1 to 28 of 28

If macro password cracked then kill thisworkbook !

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    If macro password cracked then kill thisworkbook !

    Greetings,
    If you dont want to share your macros you can put a password to your file.
    But there are some programs which are designed to crack your password.
    So, putting a password is not useful.

    Any support will be thankful if Macro1 is realizable ?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by HerryMarkowitz; 01-15-2014 at 07:48 AM.
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If macro password cracked then kill thisworkbook !

    Dream on . You've obviously realised and accepted that Excel/VBA is not a secure environment. You can make it difficult for some users to get behind the scenes and impossible for others. But, if you try to hide the workings behind a password protected VBA Project, you just make it that little bit more intriguing. You correctly state that a password cracker can remove the password. So, those who have the knowledge, will break in ... in seconds.

    But you then need to understand that if anyone cracked the VBA Project password, the chances are they would want to look at the code before they run it. So, sadly, once cracked, the macros will not be running.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    So, lets change my idea...
    If anybody try to commit to crack the password then kill thisworkbook ?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If macro password cracked then kill thisworkbook !

    Nope. The workbook won't be active and, consequently, neither will the macro(s) that you want to kill the workbook.

  5. #5
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    I have prepared following code until now...
    But user must click one of sheets after Application.VBE.MainWindow is Visible
    Please Login or Register  to view this content.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If macro password cracked then kill thisworkbook !

    You could put that code into the Workbook Sheet Selection Change event handler and it would fire any time any cell was selected on any sheet. You might want to limit it to, say, a specific range on each of the sheets.

    However, I don't seem to be getting the point across very effectively. If I cracked your VBA project, I would look at the code. I would see that there is a self destruct option and I would delete it or comment it out. But I'd be doing all of that without enabling macros in the workbook.

    Let me try to explain one more time. For a macro to be executed, macros must be enabled when the workbook is opened. If macros are not enabled, nothing will execute ... not the workbook open, not the worksheet activate, worksheet selection change, nothing. So there will NOT be an event macro active to fire your self destruct button. No self destruct, no deleted workbook.

    If I wanted to know what your code looked like and what it did, I would not be simply opening the workbook and activating macros. If I did, then your idea might work ... but then I probably would not have tried to expose the code by removing the VBE Project password. If I have removed the VBE Project password and exposed the code, I'll know what it is intended to do ... and I'll stop it.

    I can't really say it any differently, so I think I'll just drop out now.

    Regards, TMS

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: If macro password cracked then kill thisworkbook !

    Quote Originally Posted by HerryMarkowitz View Post
    I have prepared following code until now...
    But user must click one of sheets after Application.VBE.MainWindow is Visible
    Please Login or Register  to view this content.
    If the user has VBE open for another workbook (VBE may be visible without your project being viewable) your code would delete the file. I do not think user will like this. It is simpler to check ThisWorkbook.VBProject.Protection.

    Also, I must of course agree with TMS. If you have a user who will break into your workbook, he will not run the code until he has read it, so nothing that you do in VBA will work. I think it is unlikely that this is worth the trouble in my opinion: a user who is determined and capable will bypass whatever you do but most will not care so your time is wasted.
    Last edited by Izandol; 01-15-2014 at 07:33 AM.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  8. #8
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    So, you are saying that;
    You cant hide your macros anyway even you put a password.
    Lets continue investigation...

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If macro password cracked then kill thisworkbook !

    You can hide your macros, yes. And, for the average Excel user, that will be enough. But anyone with the right skills ... or anyone with access to the internet and a little patience will be able to take the password off. And look at the code. And disable any protection you have built in.

    In simple terms, you cannot protect the VBE/VBA with VBA code ... at least, not that I am aware of. Though I would welcome any suggestions

  10. #10
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: If macro password cracked then kill thisworkbook !

    You can only password lock the VBE, but the encryption is fairly low and there are plenty of free excel password recovery programs that will crack it.

    Closest thing I can think of is you make 1 macro that connects to another workbook with a login, depending on the login access, that workbook sends back the macros in strings which passes into the current workbook and it imports itself into the current workbook. The macro itself would also have to delete itself after it runs.

    You should probably consider a real database at this point or at least ms access.

  11. #11
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    Hi slx,
    You mean password can not be cracked if I use ms access ?

  12. #12
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: If macro password cracked then kill thisworkbook !

    You may create compiled file with Access. However your program may not be suitable for database.

  13. #13
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    Hi Izandol,
    I have some stock charts in the excel 2013 file.
    I have just checked that there is no stock chart option in the Access 2013

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If macro password cracked then kill thisworkbook !

    I wouldn't hold your breath there either. I have a piece of software that recovers passwords ... just tested it on two Access databases and the passwords were returned in milliseconds. Admittedly, they didn't have a VBE password, just a password to open ... and a fairly obvious one at that.

    I don't know what it is you are trying to develop or how valuable the Intellectual Property is but, if you really want to protect it, you probably need to invest in a third party encryption tool like Spreadsheet Sentry (http://www.spreadsheetsentry.com/)

    Regards, TMS

  15. #15
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: If macro password cracked then kill thisworkbook !

    @TMShucks: I'm talkin about MS Access in terms of client server. If you have the database then it is game over, this is the same with any database. With access you can build external connections this way the database is protected.

    I believe Herry's issue is he needs to have users interact with the spreadsheet and fears someone can steal the code to make it. To prevent that the code has to be compiled or there as to be restricted access on the account level.

  16. #16
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: If macro password cracked then kill thisworkbook !

    Perhaps you should look at compiling your code as an add-in rather than workbook macros?

  17. #17
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    Hi yudlugar,
    Can you give me more information about that ?

  18. #18
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: If macro password cracked then kill thisworkbook !


  19. #19
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    I know this issue.
    I mentioned this issue before.
    Password protection does not provide real protection !

  20. #20
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: If macro password cracked then kill thisworkbook !

    My understanding was that when using the code as an add-in, the source code is not available. I could be wrong though.

  21. #21
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: If macro password cracked then kill thisworkbook !

    Only if you will create a COM add-in (.dll or .xll). .xlam/.xla add-in is not really more secure than regular workbook.

  22. #22
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: If macro password cracked then kill thisworkbook !

    Making an add-in in VBA wouldn't be enough. You'd have to write it in a different language and compile it to a com addin

  23. #23
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: If macro password cracked then kill thisworkbook !

    Guys, this is starting to head towards breaking rule 11?

    11. Don't post questions regarding breaking or bypassing any security measure. Such posts will be deleted, and repeat offenders will be banned. This includes posting of links to sites that offer software, code or services to do this or posting of code to remove passwords.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  24. #24
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: If macro password cracked then kill thisworkbook !

    Hi FDibbins,
    We are not discussing regarding breaking or bypassing security measure.
    We are discussing regarding protecting security.
    Best wishes.

  25. #25
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If macro password cracked then kill thisworkbook !

    @Ford: confused ... the thread isn't about breaking security, it's about how to protect it. The OP wants to be able to say, "you've gone behind the curtains, I'm shutting down now".

    I think it's a useful discussion. Wish I knew how to write a com add-in

  26. #26
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: If macro password cracked then kill thisworkbook !

    Quote Originally Posted by TMShucks View Post
    Wish I knew how to write a com add-in
    With VB6 (or old Office Developer edition) this was simple. With .Net is not quite so simple but yet not so difficult. It does not seem to perform so well however - I think COM interop degrades performance.

  27. #27
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: If macro password cracked then kill thisworkbook !

    this was simple
    Maybe for you. I wouldn't know where to start

  28. #28
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: If macro password cracked then kill thisworkbook !

    Now is always good time to learn.

    http://msdn.microsoft.com/en-us/libr...ice.10%29.aspx
    Last edited by Izandol; 01-21-2014 at 01:10 PM.

+ 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. Complex SaveAs and Kill Macro Help
    By Sh0ck3d in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2013, 08:22 PM
  2. Macro to kill linkages to other sheet but keep the formula
    By Excel Dumbo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 08:55 PM
  3. Kill excel if Macro password is wrong
    By mani.ragi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2010, 09:52 AM
  4. Please help to kill Virus Excel 4.0 Macro
    By OverAC in forum Excel General
    Replies: 3
    Last Post: 09-22-2006, 12:14 AM
  5. [SOLVED] How to Kill a vba macro from a Function//
    By coco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2005, 07:05 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