Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VB Script file save as with date

I have a daily metric where I import the data & run with Excel VB script. I'd
like have the script save this as a certain date value in the filename every
day. I have tried using a cell value, then referring to
ActiveWorkbook.SaveAs Filename:=ActiveCell.Value, however, I need to save it
as \\server\reports\daily_market_status 2005-01-13.xls

I have tried using the =today() date format in a cell and cocatenating with
the active saveas cell value, but I just get the date serial number in the
formula.

Any hints?
Thanks!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VB Script file save as with date

Filename:=" \\server\reports\daily_market_status\" &
Format(Date,"yyyy-mm-dd") & .xls


Date is the vba equivalent of Today() in the worksheet.
--
Regards,
Tom Ogilvy
"nixter" wrote in message
...
I have a daily metric where I import the data & run with Excel VB script.

I'd
like have the script save this as a certain date value in the filename

every
day. I have tried using a cell value, then referring to
ActiveWorkbook.SaveAs Filename:=ActiveCell.Value, however, I need to save

it
as \\server\reports\daily_market_status 2005-01-13.xls

I have tried using the =today() date format in a cell and cocatenating

with
the active saveas cell value, but I just get the date serial number in the
formula.

Any hints?
Thanks!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VB Script file save as with date

Use the format function

Format(ActiveCell.Value, "yy-mm-dd")

like this
" \\server\reports\daily_market_status" & " " & Format(ActiveCell.Value, "yy-mm-dd")

--
Regards Ron de Bruin
http://www.rondebruin.nl



"nixter" wrote in message ...
I have a daily metric where I import the data & run with Excel VB script. I'd
like have the script save this as a certain date value in the filename every
day. I have tried using a cell value, then referring to
ActiveWorkbook.SaveAs Filename:=ActiveCell.Value, however, I need to save it
as \\server\reports\daily_market_status 2005-01-13.xls

I have tried using the =today() date format in a cell and cocatenating with
the active saveas cell value, but I just get the date serial number in the
formula.

Any hints?
Thanks!!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VB Script file save as with date

Misread what you want the filename to be (and left the quotes off ".xls"),
so here is a modification

Filename:=" \\server\reports\daily_market_status " & _
Format(Date,"yyyy-mm-dd") & ".xls"


--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Filename:=" \\server\reports\daily_market_status\" &
Format(Date,"yyyy-mm-dd") & .xls


Date is the vba equivalent of Today() in the worksheet.
--
Regards,
Tom Ogilvy
"nixter" wrote in message
...
I have a daily metric where I import the data & run with Excel VB

script.
I'd
like have the script save this as a certain date value in the filename

every
day. I have tried using a cell value, then referring to
ActiveWorkbook.SaveAs Filename:=ActiveCell.Value, however, I need to

save
it
as \\server\reports\daily_market_status 2005-01-13.xls

I have tried using the =today() date format in a cell and cocatenating

with
the active saveas cell value, but I just get the date serial number in

the
formula.

Any hints?
Thanks!!





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
Excel 2007 Can't Save File with VB Script but it can in 97/2003format??? [email protected] Excel Discussion (Misc queries) 2 February 9th 09 03:38 PM
can't save VBA script when saving excel file thinktwice Excel Discussion (Misc queries) 5 December 27th 06 07:38 AM
Save Excel File every wednesday VB Script Help !! sam76210 Excel Discussion (Misc queries) 0 March 8th 06 04:05 PM
Script to save Excel file to the server. raj41977 Excel Discussion (Misc queries) 3 December 8th 05 02:48 PM
when i save xls file, debug script is running and canno't save fil Imtiaz Excel Discussion (Misc queries) 1 July 16th 05 03:47 PM


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

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

About Us

"It's about Microsoft Excel"