I have made comments where I would like things to happen in red.
![]()
Please Login or Register to view this content.
I have made comments where I would like things to happen in red.
![]()
Please Login or Register to view this content.
Try:
Dom![]()
Please Login or Register to view this content.
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
It looks like that is working.
The save and saveas function is not working completely either. Can you take a look at my code for that. It crashes excel when I go to save. I want it to disable save and saveas completely. That also means grey it out on the menu or remove it from the menu. They must use the submit button to both save then email.
Hi,
You can only have one Workbook_Open event code so you would need to pop your code to disable the menu items at the start of your other event code.
I didn't get any errors when I tested it. To have the option to save from a button pop this code in a standard module:
And change your BeforeSave event code to this:![]()
Please Login or Register to view this content.
You will then also be able to attach the save_file macro to a button from the forms toolbar that the user will be able to click as required.![]()
Please Login or Register to view this content.
Hope it helps,
Dom
I wanted to ensure that both save and save as are disabled I have it function correctly now. Only thing i need to do is make sure that on submit button the file is saved and emailed with the code I have for save_file and Sub SendMail. I have a submit button created how do I get the code into the submit button for the save and email function.
![]()
Please Login or Register to view this content.
You can either combine the save and email code into one procedure or have an additional one like this that will run each in turn:
If you use a button from your Forms toolbar you can then just right click on it and assign the above macro to it.![]()
Please Login or Register to view this content.
From your post I'm assuming that you have all the above code on the ThisWorkbook code page of your workbook's VBA project. Everything apart from the Workbook_Open and Workbook_BeforeSave code should really sit within a standard VBA module rather than there. To add a module to your project just right click on it in the project explorer and select Insert...Module.
Dom
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks