ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Naming a workbook WITHOUT saving it? (https://www.excelbanter.com/excel-programming/356683-re-naming-workbook-without-saving.html)

Tom Ogilvy

Naming a workbook WITHOUT saving it?
 
? environ("temp")
C:\DOCUME~1\OgilvyTW\LOCALS~1\Temp

sPath = environ("temp") & "\"
activeworkbook.SaveAs sPath & "Myfile.xls"
' send the file
sName = Activeworkbook.Fullname
Activeworkbook.Close SaveChanges:=False
Kill sName

--
Regards,
Tom Ogilvy



"Maury Markowitz" wrote:

"Tom Ogilvy" wrote:

No, you must save it to name it.

However after sending it you could Kill it

kill "C:\Temp\Mybooks.xls"


Fair enough! Is \temp\ always available on C?

Maury


Maury Markowitz

Naming a workbook WITHOUT saving it?
 
"Tom Ogilvy" wrote:

sPath = environ("temp") & "\"
activeworkbook.SaveAs sPath & "Myfile.xls"
' send the file
sName = Activeworkbook.Fullname
Activeworkbook.Close SaveChanges:=False
Kill sName


Awsome, thanks. I've always wondered how to do that...

Maury
Regards,
Tom Ogilvy



"Maury Markowitz" wrote:

"Tom Ogilvy" wrote:

No, you must save it to name it.

However after sending it you could Kill it

kill "C:\Temp\Mybooks.xls"


Fair enough! Is \temp\ always available on C?

Maury



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com