PC Review


Reply
Thread Tools Rate Thread

Create dummy file structure?

 
 
Ray
Guest
Posts: n/a
 
      21st Feb 2007
I'm working on a template that will house several types of data --
some inputted directly into the workbook, other data being linked to
multiple external workbooks. When I say 'multiple', I'm thinking one
for every day of the year!

In order to make the links to these external workbooks, I'd like to
first create the exact file structure -- users can simply then 'save-
as' over top of the existing workbook. Is there a way to create this
file structure using VBA? That is, can I have Excel repeatedly 'save-
as' the current workbook, using the date as the file name?

The desired path would look like this:
\\server\folder1\folder2\StoreName\January1.xls
\\server\folder1\folder2\StoreName\January2.xls
\\server\folder1\folder2\StoreName\January3.xls
\\server\folder1\folder2\StoreName\January4.xls
etc....

Ideas?

TIA, Ray

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      21st Feb 2007
spath = "\\server\folder1\folder2\StoreName\"
Thisworkbook.SaveAs sPath & format(date,"mmmmd") & .xls

It might be better to use


Thisworkbook.SaveAs sPath & format(date,"mmmmdd") & .xls
--
Regards,
Tom Ogilvy



"Ray" wrote:

> I'm working on a template that will house several types of data --
> some inputted directly into the workbook, other data being linked to
> multiple external workbooks. When I say 'multiple', I'm thinking one
> for every day of the year!
>
> In order to make the links to these external workbooks, I'd like to
> first create the exact file structure -- users can simply then 'save-
> as' over top of the existing workbook. Is there a way to create this
> file structure using VBA? That is, can I have Excel repeatedly 'save-
> as' the current workbook, using the date as the file name?
>
> The desired path would look like this:
> \\server\folder1\folder2\StoreName\January1.xls
> \\server\folder1\folder2\StoreName\January2.xls
> \\server\folder1\folder2\StoreName\January3.xls
> \\server\folder1\folder2\StoreName\January4.xls
> etc....
>
> Ideas?
>
> TIA, Ray
>
>

 
Reply With Quote
 
Ray
Guest
Posts: n/a
 
      21st Feb 2007
On Feb 21, 10:26 am, Tom Ogilvy <TomOgi...@discussions.microsoft.com>
wrote:
> spath = "\\server\folder1\folder2\StoreName\"
> Thisworkbook.SaveAs sPath & format(date,"mmmmd") & .xls
>
> It might be better to use
>
> Thisworkbook.SaveAs sPath & format(date,"mmmmdd") & .xls
> --
> Regards,
> Tom Ogilvy
>
> "Ray" wrote:
> > I'm working on a template that will house several types of data --
> > some inputted directly into the workbook, other data being linked to
> > multiple external workbooks. When I say 'multiple', I'm thinking one
> > for every day of the year!

>
> > In order to make the links to these external workbooks, I'd like to
> > first create the exact file structure -- users can simply then 'save-
> > as' over top of the existing workbook. Is there a way to create this
> > file structure using VBA? That is, can I have Excel repeatedly 'save-
> > as' the current workbook, using the date as the file name?

>
> > The desired path would look like this:
> > \\server\folder1\folder2\StoreName\January1.xls
> > \\server\folder1\folder2\StoreName\January2.xls
> > \\server\folder1\folder2\StoreName\January3.xls
> > \\server\folder1\folder2\StoreName\January4.xls
> > etc....

>
> > Ideas?

>
> > TIA, Ray


Thanks Tom ... but how do I get the macro to scroll through each date
to create the files? In other words, I want to create all 365 files
today!

I'm thinking that I could enter the dates in cells A1:A365, but I'm
not sure how to modify your code to make Excel progress down the
column, saving a new file for each date?

ray

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      21st Feb 2007
Sub ABC()
Dim spath as String, i as Long, dt as Date
spath = "\\server\folder1\folder2\StoreName\"
for i = 1 to 365
dt = dateserial(2007,1,i)
Thisworkbook.SaveAs sPath & format(dt,"mmmmd") & .xls
Next
End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote:

> spath = "\\server\folder1\folder2\StoreName\"
> Thisworkbook.SaveAs sPath & format(date,"mmmmd") & .xls
>
> It might be better to use
>
>
> Thisworkbook.SaveAs sPath & format(date,"mmmmdd") & .xls
> --
> Regards,
> Tom Ogilvy
>
>
>
> "Ray" wrote:
>
> > I'm working on a template that will house several types of data --
> > some inputted directly into the workbook, other data being linked to
> > multiple external workbooks. When I say 'multiple', I'm thinking one
> > for every day of the year!
> >
> > In order to make the links to these external workbooks, I'd like to
> > first create the exact file structure -- users can simply then 'save-
> > as' over top of the existing workbook. Is there a way to create this
> > file structure using VBA? That is, can I have Excel repeatedly 'save-
> > as' the current workbook, using the date as the file name?
> >
> > The desired path would look like this:
> > \\server\folder1\folder2\StoreName\January1.xls
> > \\server\folder1\folder2\StoreName\January2.xls
> > \\server\folder1\folder2\StoreName\January3.xls
> > \\server\folder1\folder2\StoreName\January4.xls
> > etc....
> >
> > Ideas?
> >
> > TIA, Ray
> >
> >

 
Reply With Quote
 
Ray
Guest
Posts: n/a
 
      21st Feb 2007
On Feb 21, 11:04 am, Tom Ogilvy <TomOgi...@discussions.microsoft.com>
wrote:
> Sub ABC()
> Dim spath as String, i as Long, dt as Date
> spath = "\\server\folder1\folder2\StoreName\"
> for i = 1 to 365
> dt = dateserial(2007,1,i)
> Thisworkbook.SaveAs sPath & format(dt,"mmmmd") & .xls
> Next
> End Sub
>
> --
> Regards,
> Tom Ogilvy
>
> "Tom Ogilvy" wrote:
> > spath = "\\server\folder1\folder2\StoreName\"
> > Thisworkbook.SaveAs sPath & format(date,"mmmmd") & .xls

>
> > It might be better to use

>
> > Thisworkbook.SaveAs sPath & format(date,"mmmmdd") & .xls
> > --
> > Regards,
> > Tom Ogilvy

>
> > "Ray" wrote:

>
> > > I'm working on a template that will house several types of data --
> > > some inputted directly into the workbook, other data being linked to
> > > multiple external workbooks. When I say 'multiple', I'm thinking one
> > > for every day of the year!

>
> > > In order to make the links to these external workbooks, I'd like to
> > > first create the exact file structure -- users can simply then 'save-
> > > as' over top of the existing workbook. Is there a way to create this
> > > file structure using VBA? That is, can I have Excel repeatedly 'save-
> > > as' the current workbook, using the date as the file name?

>
> > > The desired path would look like this:
> > > \\server\folder1\folder2\StoreName\January1.xls
> > > \\server\folder1\folder2\StoreName\January2.xls
> > > \\server\folder1\folder2\StoreName\January3.xls
> > > \\server\folder1\folder2\StoreName\January4.xls
> > > etc....

>
> > > Ideas?

>
> > > TIA, Ray


Works perfectly ... thanks Tom!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create shortcut of file only and folder structure Luc Windows XP Customization 2 17th Nov 2005 09:38 PM
Create dummy email accounts =?Utf-8?B?YW5ub255bW91cw==?= Microsoft Outlook Installation 0 16th Sep 2005 11:56 AM
Create Outlook Public Folders to match File Structure? kristy@fluidsoftware.co.nz Microsoft Outlook Program Addins 1 6th Mar 2005 10:22 AM
Create Dummy Printer John Windows XP Help 3 9th Sep 2004 04:12 AM
How to create a pst with structure copied from another pst file ? steven Microsoft Outlook VBA Programming 0 7th Aug 2004 07:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:11 PM.