Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Automatically generate a unique file name via macro...

You're on the right track, but I think the problem is in the use of the
Format function. You *may* have to encapsulate the call to Format in a
Str() function in your concatenation. But why use Format at all? I just
use something like Trim(Date) in similar circumstances and it works fine.

I'd also include the userID in that string, or create individual user
folders for the output. Your customers will probably prefer the latter,
based on my own experience along these lines.

Randall Arnold

"Ian L." wrote in message
...
I have an excel (XP version) application in use on a
network. The app is being run by 50+ different users,
and currently they output the final result sheet to a
printer on completion.

I would like to save some trees and instead of printing
the output, I would like to save it to a folder on the
network. The problem is, each user prints between 5 &
10 of these sheets per shift.

Not all of the users are computer savvy, so in order to
avoid everyone saving their files over everyone elses, I
would need to write a macro that would save the file
automatically to a specific folder. At the same time it
would also need to generate a unique file name for each
individual user!

Does anyone know if this is possible, and can you give me
any pointers please?

I tried something like this:

Thisworkbook.SaveAs "X:\SpecialFolder\ & "ABC" & _
format(now,"yyyymmdd_hhmm") & ".xls"

but I get syntax errors or expected end of statement
errors.

Thanks in advance.

Ian.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Automatically generate a unique file name via macro...

Thanks Randall... I'm pretty new to this, I was given the
idea from a previous post.

I'm grateful for your reply, but what you said didn't mean
a great deal to me, could you break it down into something
a novice like me could understand please?

Thanks

Ian


-----Original Message-----
You're on the right track, but I think the problem is in

the use of the
Format function. You *may* have to encapsulate the call

to Format in a
Str() function in your concatenation. But why use Format

at all? I just
use something like Trim(Date) in similar circumstances

and it works fine.

I'd also include the userID in that string, or create

individual user
folders for the output. Your customers will probably

prefer the latter,
based on my own experience along these lines.

Randall Arnold

"Ian L." wrote in message
...
I have an excel (XP version) application in use on a
network. The app is being run by 50+ different users,
and currently they output the final result sheet to a
printer on completion.

I would like to save some trees and instead of printing
the output, I would like to save it to a folder on the
network. The problem is, each user prints between 5 &
10 of these sheets per shift.

Not all of the users are computer savvy, so in order to
avoid everyone saving their files over everyone elses, I
would need to write a macro that would save the file
automatically to a specific folder. At the same time it
would also need to generate a unique file name for each
individual user!

Does anyone know if this is possible, and can you give

me
any pointers please?

I tried something like this:

Thisworkbook.SaveAs "X:\SpecialFolder\ & "ABC" & _
format(now,"yyyymmdd_hhmm") & ".xls"

but I get syntax errors or expected end of statement
errors.

Thanks in advance.

Ian.




.

Reply
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
automatically generate unique serial numbers for invoices nhlanhla Excel Worksheet Functions 1 October 2nd 08 12:50 PM
How to generate a text file from Excel using a macro or script? Frank Excel Discussion (Misc queries) 1 January 6th 08 05:11 PM
How to generate a text file from Excel using a macro or script? Frank Excel Discussion (Misc queries) 0 January 6th 08 05:11 PM
Macro to generate a file from another Dileep Chandran Excel Worksheet Functions 10 December 4th 06 02:52 PM
Automatically Generate a unique file name... Ian L Excel Programming 3 July 15th 03 02:08 AM


All times are GMT +1. The time now is 10:32 PM.

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

About Us

"It's about Microsoft Excel"