Welcome
Welcome to <strong>SpreadCE / Spread32</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Create backup copy with macro

Post your comments, questions, bug reports and feature requests here.

Create backup copy with macro

Postby BKORNEL on Wed May 06, 2009 7:48 am

Stephen,

First of all - the software is great, can be easily used and have enough flexibility even if the worksheet is protected. I am really thankful that it exists :)

About the issue..

I am not familiar with the macro 4.0 language so could you please let me know how it is possible to :

1. Save workbook 'Master.xls'
2. Save it as 'Master_Backup.xls'
3. Close the backup
4. ..and continue to work with the original ( 'Master.xls' ) ?

I had a weak attempt to solve it, but it was not really successful :

=SAVE()
=SAVE.AS("\SD Card\Master_Backup.xls")
=FILE.CLOSE(TRUE,FALSE)
=OPEN("\SD_Card\Master.xls",1)

Thanks in advance for your help.
Kornel
BKORNEL
 
Posts: 5
Joined: Tue May 05, 2009 8:52 pm

Postby stephenbye on Wed May 06, 2009 10:17 pm

Hi Kornel,

When you use the SAVE.AS macro command to save a file with a different name, then the file that you are working on will be renamed to the new name. For example, if you are working on a file called "Master.xls" and you save it as "Master_Backup.xls", then the file that you are working on will now be called "Master_Backup.xls".

What you really need is the SAVE.COPY.AS macro command, which will save a copy of the current file with a different name, but not change the name of the file that you are working on. I have not yet implemented that command, but I will try to get it done in the next few weeks for you.

In the meantime, I think that the best way would be to save the file first as "Master_Backup.xls" and then again as "Master.xls". This will cause the name to change from Master.xls to Master_Backup.xls and then back again to Master.xls. This will take twice as long as the SAVE.COPY.AS macro command because it causes the file to be saved twice, but it should work for now:

=SAVE.AS("\SD Card\Master_Backup.xls")
=SAVE.AS("\SD Card\Master.xls")
=RETURN()
stephenbye
Site Admin
 
Posts: 157
Joined: Sun Aug 12, 2007 11:56 pm

Postby BKORNEL on Thu May 07, 2009 12:52 pm

Stephen,

I noticed that the SAVE.COPY.AS is missing - that's why I tried the SAVE.AS instead :)
( Thanks very much for the implementation in advance ! )

I must say: the simplicity of your solution makes it great..now I am just mad because I should have come to this myself :)

Thanks again,
Kornel
BKORNEL
 
Posts: 5
Joined: Tue May 05, 2009 8:52 pm

Postby stephenbye on Sat May 09, 2009 6:30 pm

Hi Kornel,

I have now implemented the SAVE.COPY.AS macro function.
Please let me know which version of the software you are using and I will send you an updated copy.
stephenbye
Site Admin
 
Posts: 157
Joined: Sun Aug 12, 2007 11:56 pm

Postby BKORNEL on Tue Jun 02, 2009 9:06 am

Stephen,

Sorry for late replying ( I did not expect a prompt reaction :)
I use the Pocket PC 2003 Windows Mobile ( English ) version.

Thank you very much for your help.

Kornél
BKORNEL
 
Posts: 5
Joined: Tue May 05, 2009 8:52 pm

Postby BKORNEL on Tue Jun 02, 2009 12:51 pm

Stephen,

I am not sure if I should open a new topic, or not, but - as my question is related to the saving of the workbook - I think this time I do not do this..

In case somebody uses the built-in FORM to update the records in the spreadsheet is there a potential danger of data loss ?
( As the File menu is not available until the FORM is open, I am not sure what happens if the user forgets to Save the data..not to mention if the PDA's battery is at low level. )

I noticed that SpreadCE stays in memory until the File/Exit command is not executed, but I would like to be sure that everything runs smooth.

Thanks very much in advance, and sorry for bothering you with this.

Kornél
BKORNEL
 
Posts: 5
Joined: Tue May 05, 2009 8:52 pm

Postby stephenbye on Wed Jun 03, 2009 10:07 pm

I have sent you the updated version of the program.

You are correct, none of the menu options are available while the Form dialog box is displayed. If the user wants to save the data entered so far, they will have to close the Form dialog box. I cannot think of an alternative way to handle this.
stephenbye
Site Admin
 
Posts: 157
Joined: Sun Aug 12, 2007 11:56 pm

Postby BKORNEL on Thu Jun 04, 2009 7:38 am

Stephen,

Thank you for your kind ( and unbelievably fast ) reply for my question.
I was afraid that the form should be left for saving, but this is really not a big issue.

The SAVE.COPY.AS macro works great :lol:

Best wishes,
Kornél
BKORNEL
 
Posts: 5
Joined: Tue May 05, 2009 8:52 pm


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron