View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_5_] Dana DeLouis[_5_] is offline
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