Apologies in advance if this is not very well explained but I'm pretty much a total novice when it comes to VB and have only managed to get this far by searching Google for people with similar problems and modifying their solutions as well as some superb help on here.
Anyway. I have what I think is a complex workbook with lots of macros in it performing all manner of functions. The purpose of the workbook is to generate job sheets (hence it's called Job Sheet Generator) so I launch this workbook, I click a button that resets all the cells and generates a new job number, I enter the relevant job information and then click another button and it saves it as a new workbook in the relevant clients folder with the appropriate file name. This new workbook is then the actual Job Sheet and more information is added as the job progresses and other macros come into play.
Everything was working fine but then I decided to complicate matters. Because the workbook has so many macros in it I wanted to 'force' users to enable macros both in the Job Sheet Generator and in the Job Sheets it creates. So I created a new worksheet in the Job Sheet Generator with a message saying that macros had to be enabled and instructions on how to do this and then added another bit of VB that hid this message if macros are enabled or hid all the other worksheets if macros are not enabled.
If I just click on the button that saves the workbook as a new Job sheet everything is fine and If I open up the resulting job sheet and don't have macros enabled it shows me the message. Equally if I do have macros enabled, it doesn't show me the message. This is exactly how I want it.
However if, as I actually need to, I click on the button that resets all the cells in the Job Sheet Generator and generates a new job number, then enter the new information and click on the button that then saves it as a new Job sheet the job sheet doesn't appear to work in that whether I have macros enabled or not I never see the message about having to enable macros.
So presumably there is something in the VB of the reset macro that is killing the other macro.
This is the code for the reset and generate job number:
This is the code for the macro that saves it as a new job sheet:Please Login or Register to view this content.
All of these macros and others are in Modules 1 in the VBA project (I've no idea what that means or why it's in there but think from memory I just followed a guide that said to do that)Please Login or Register to view this content.
This is the code that hides or reveals the enable macros message:
This code is in ThisWorkbook within the VBA Project (Again I just followed instructions on another website so don't know if this is the correct place or not)Please Login or Register to view this content.
Can anyone see what is causing the job sheet that is generated to NOT have a working enable macro message if I've first clicked on the reset button in the generator?
</outofmydepth>
Bookmarks