Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Saving file using data from worksheet

I came up with this code to save the active worksheet with a set name and
the contents of cell Y1 included in the name. But when I finish enter the
code the program highlights the word Vacation and gives me the following
error msg "Expected end of statement"

ActiveWorkbook.SaveAs Filename:= _
"O:\PT_DRIVER_SCHED\"Vacation Mark-up (PT Drivers) &
Worksheets("January").[Y1].Value", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Saving file using data from worksheet

Hi Patrick,

Try changing your quotes:

ActiveWorkbook.SaveAs Filename:= _
"O:\PT_DRIVER_SCHED\Vacation Mark-up (PT Drivers)" _
& Worksheets("January").[Y1].Value, _
FileFormat:=xlNormal, Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=True

---
Regards,
Norman



"Patrick Simonds" wrote in message
...
I came up with this code to save the active worksheet with a set name and
the contents of cell Y1 included in the name. But when I finish enter the
code the program highlights the word Vacation and gives me the following
error msg "Expected end of statement"

ActiveWorkbook.SaveAs Filename:= _
"O:\PT_DRIVER_SCHED\"Vacation Mark-up (PT Drivers) &
Worksheets("January").[Y1].Value", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True



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
Saving only current worksheet into new file BobC Excel Discussion (Misc queries) 3 January 9th 09 01:16 PM
Saving Worksheet to new file by tab name Bobzter100 Excel Discussion (Misc queries) 7 November 12th 07 08:55 AM
Saving worksheet in new file with date AND cell value as file name michaelberrier Excel Discussion (Misc queries) 4 May 26th 06 08:05 PM
Saving to a worksheet in another file...? nickclingan Excel Discussion (Misc queries) 3 February 3rd 06 05:14 PM
Saving worksheet to .doc file CrashandBurn Excel Programming 0 February 10th 04 03:32 AM


All times are GMT +1. The time now is 11:30 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"