Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Random file name

Is there a way to create a random/unique workbook name in Excel that
can be created by a macro at the beginning, the macro continues on
with its chores, and then, at the end, deletes that workbook? The
workbook is temporary in nature and does not need to exist after the
macro executes.

I am more familiar with writing code in Foxpro than I am with Excel.


Ahí namá,


Robert Melbo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default Random file name

You could probably get a zillion hits using "unique workbook name" at Google
groups.

http://groups.google.com/grphp?hl=en

Nevertheless, look for the posting from 7/17/2003 whose subject is
"Automatically generate a unique file name via macro"

Bob Kilmer

"Robert Melbo" wrote in message
...
Is there a way to create a random/unique workbook name in Excel that
can be created by a macro at the beginning, the macro continues on
with its chores, and then, at the end, deletes that workbook? The
workbook is temporary in nature and does not need to exist after the
macro executes.

I am more familiar with writing code in Foxpro than I am with Excel.


Ahí namá,


Robert Melbo



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Random file name

Just use time as a source for the name - it isn't random, but it shouldn't
be duplicated

sName = Format(now,"yyyymmdd_hhmmss") & ".xls"

to demo from the immediate window:
? Format(now,"yyyymmdd_hhmmss") & ".xls"
20030721_095957.xls


But you can create a new workbook and work with it, then

Activeworkbook.Close SaveChanges:=false

without giving it a name or saving it.

Regards,
Tom Ogilvy

"Robert Melbo" wrote in message
...
Is there a way to create a random/unique workbook name in Excel that
can be created by a macro at the beginning, the macro continues on
with its chores, and then, at the end, deletes that workbook? The
workbook is temporary in nature and does not need to exist after the
macro executes.

I am more familiar with writing code in Foxpro than I am with Excel.


Ahí namá,


Robert Melbo



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Random file name


"Robert Melbo" wrote in message
...
Is there a way to create a random/unique workbook name in Excel that
can be created by a macro at the beginning, the macro continues on
with its chores, and then, at the end, deletes that workbook? The
workbook is temporary in nature and does not need to exist after the
macro executes.


Why would you want to do this ?

If you open an Excel session you get a workbook who's name
defaults to Book1 but if you dont save it when you close
the session it never gets written to disk anyway.

If you really want a unique name for the workbook generate
a GUID

http://support.microsoft.com:80/supp...NoWebContent=1

Keith


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Random file name

If you really do need to create a temp name, Excel vba has a method that
generates random names. It's advertised for this purpose. You would have
to adjust it to fit your needs. There are many other different options
besides this though.

Sub Demo()
Dim TempFileName
TempFileName = Left$("Excel_" &
CreateObject("Scripting.FileSystemObject").GetTemp Name, 14)
Debug.Print TempFileName
End Sub

returns: Excel_radBD8CE

--
Dana DeLouis
I am using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Robert Melbo" wrote in message
...
Is there a way to create a random/unique workbook name in Excel that
can be created by a macro at the beginning, the macro continues on
with its chores, and then, at the end, deletes that workbook? The
workbook is temporary in nature and does not need to exist after the
macro executes.

I am more familiar with writing code in Foxpro than I am with Excel.


Ahí namá,


Robert Melbo



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
Sorting random Data created from a random formula Six Sigma Blackbelt Excel Discussion (Misc queries) 1 September 11th 08 11:03 PM
Random help please Terry Excel Worksheet Functions 4 September 4th 08 11:35 AM
Non-random numbers generated by excel's data analysis random gener Allie Excel Worksheet Functions 10 September 17th 05 06:19 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM
How do I find random number in list of random alpha? (Position is. jlahealth-partners Excel Discussion (Misc queries) 0 February 8th 05 05:31 PM


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

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"