Working with vba expiration date. Need to rescue my workbook if possible!

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi!
In one of the workbook, i use a code like this...when it reaches expiry date it gvies pop up...& then closes it...so there is no way (as for me I dont know a way) to stop it from closing as u all know how fast the macro is....I was trying to re-open and change the setting but it does not allow me to do anything now as it has expired. Is there a way i can make changes to this macro from another code or something???:biggrin:


Please advice if you've any idea....!!!



Code:
Sub Auto_Open()
    Dim exdate As Date
    exdate = "7/30/2010"
    If Date > exdate Then
        MsgBox ("You have reached end of your trial period")
        ActiveWorkbook.Close
    End If 
    MsgBox ("You have " & exdate - Date & "Days left")
End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You can hold down the Shift key when you open the workbook to halt code execution. Or disable macros, then open the WB.

Also note that you can avoid this in the future by putting a user name test in the code - if the code sees that it's you it'll exit, otherwise execute.

HTH,
 
Upvote 0
Open another workbook, or start a new one.

Set the Security to High.

Open the workbook in question, and change the date as necessary. Save and close the file.

Lower the security back to its previous setting.
 
Upvote 0
Smitty, hi!
thanks for advice...i'll give it a try..not sure about the user thing..but if you could design me a sample code or something would be great....!;)

PA HS Teacher, thanks for inputting..do you mean like turning of the macro so that it wont do anything??? and then i can open it as normal book???
 
Upvote 0
Wow...disabling all macros did the job!!!!

Thanks guys..i think i'll nto trouble you guys more then I should...:biggrin:


Good night!;)
 
Upvote 0
You can hold down the Shift key when you open the workbook to halt code execution. Or disable macros, then open the WB.

Also note that you can avoid this in the future by putting a user name test in the code - if the code sees that it's you it'll exit, otherwise execute.

HTH,
This worked for me. Thank you for sharing. ?
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top