AutoSave When Submitting info on a Userfotm

jdu007

Board Regular
Joined
May 11, 2008
Messages
91
Hi folks.

I have created a Userform that transfers data from the form to a worksheet at the click of a button (cmdSubmit).

What I'd like to do at the same time is copy the destination worksheet (or the whole workbook?) to a new folder elsewhere, just in case the original gets accidentally deleted. The Userform will be regularly used, and the destination worksheet will quickly fill up - so I can't afford for it to get lost as I'll have no way of recovering the data.

Any help greatly appreciated.

Thanks!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Something like this :
Code:
ThisWorkbook.SaveCopyAs "Enter_Your_Full_File_Name_Here"
 
Upvote 0
Hi Jaafar.

Thanks for the response, much appreciated.

However, it doesn't seem to work, but I'm not sure it's due to your code... I'm getting a pop-up box appear, saying Excel cannot access the file, as it either doesn't exist (which it does), is being used by another program (which it's not), or has the same name as the currently open workbook (which it isn't).

Any further help greatly appreciated!

Many thanks in advance,

John.
 
Upvote 0
Are you giving the workbook copy a different name from the current workbook name ?
ie: ThisWorkbook.SaveCopyAs "Enter_Your_New_Full_File_Name_Here"
 
Upvote 0

Forum statistics

Threads
1,216,115
Messages
6,128,923
Members
449,479
Latest member
nana abanyin

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