LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Automatically save report to new file name each month

Hi Helmut and Walt,

Today was my first day back at work since my initial post, so I was able to
try out the code.

In the end, I have decided that it is easier to create a new file (eg
October05.xls) on the first of the month from the report template file and
have the data saved to that throughout the month (by using the generic
MMMMYY.xls format to open the correct report file and import the data), so
the code now looks a little different to the one you supplied.

However, without your help, I would not have been able to written the code I
am now using. As I said, I am very new to VB programming, so to do this alone
I would not have known where to start. I find that the help in VB editor
pretty much useless.

A very big thank you from Melbourne, Australia to you both for your
assistance.



"Helmut Weber" wrote:

Hieverybody,

and thanks to Walt for "savecopyas".

From my (very) limited knowledge of VB programming, the code looks as though
it first opens the report workbook, then sees if there is already a current
month file. If not it then saves the workbook as MMMYY.xls (or something
similar). Is this correct?


Not quite. I thought of putting the code
into the, lets call it "master report". So it doesn't open the
master report, it just runs if the master report is openened.

Is it possible to check whether the file exists first and then, if it
doesn't, open the report workbook and save it as the month name?


If the code is in a third workbook like "program.xls", yes.

Also, is there something in this code that says that it only needs to occur
the first time program.xls is opened in a new month?


Not really, but the very existence of e.g. 2005-09.xls indicates,
that the master report was once opened in September and saved
as the monthly report.

To clarify, what I would like to do is, on the first day that program.xls is
opened in October, save the data that had been entered into report.xls as
September05.xls (or similar) and clear report.xls so that Octobers data can
be saved into it (and then saved as October05.xls in November.


Hm, I see, then get the month, eg 9, deduct 1, check whether 2005-08
already exists. Though with that you'll have to deduct 1 from
the number of the year in January, too, and set the month to 12!


And with more than 1 workbook open, working with
activeworkbook is dangereous, rather use
e.g. workbooks("NameofBook.xls").

Sorry for these silly question, but I am very new to VB programming.


And I'm rather new to Excel-programming.

--
Greetings from Bavaria, Germany

Helmut Weber

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up a file to automatically save on exit? Brian Excel Discussion (Misc queries) 1 May 15th 10 04:34 PM
How do I have Excel automatically save a file periodically? [email protected] Excel Discussion (Misc queries) 3 October 20th 09 09:47 PM
Can I set a file to auto-open and save at each month begin date? Dominic Excel Discussion (Misc queries) 9 August 8th 09 05:57 PM
Saving file as current month name automatically gold Excel Discussion (Misc queries) 2 August 25th 07 05:34 PM
Automatically save a file in another directory MarkT Excel Discussion (Misc queries) 4 September 18th 06 02:53 PM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"