#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SaveAs

Hello,
I know that this is an easy question, and is perhaps due
to my Syntax (or at least that is the error I am getting).
I am trying to write a SaveAs function which would save
the Excel workbook using a reference to a cell. For
example, I would like to save the file as "***.xls", where
*** is the information contained in cell C4. So far I
have been trying to use the following, but it is not
working...

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\user\My documents\"
& "ActiveWorkbook.WorkSheet("Sheet1").Cells(3, 4)"
& ".xls",

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default SaveAs

Steve,

Get rid of the quotes in

"ActiveWorkbook.WorkSheet("Sheet1").Cells(3, 4)"

For example,

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\user\My documents\" & _
ActiveWorkbook.Worksheet("Sheet1").Cells(3, 4) & _
".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Steve" wrote in message
...
Hello,
I know that this is an easy question, and is perhaps due
to my Syntax (or at least that is the error I am getting).
I am trying to write a SaveAs function which would save
the Excel workbook using a reference to a cell. For
example, I would like to save the file as "***.xls", where
*** is the information contained in cell C4. So far I
have been trying to use the following, but it is not
working...

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\user\My documents\"
& "ActiveWorkbook.WorkSheet("Sheet1").Cells(3, 4)"
& ".xls",



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default SaveAs

Hi,
This is still giving me syntax error. Is it possible to
show me the entire code, include the ActiveWorkbook
statement? I`ve seen another example here in the
newsgroup, but trying that also did not work...
Thank you,
Steve
-----Original Message-----
Hello,
I know that this is an easy question, and is perhaps due
to my Syntax (or at least that is the error I am

getting).
I am trying to write a SaveAs function which would save
the Excel workbook using a reference to a cell. For
example, I would like to save the file as "***.xls",

where
*** is the information contained in cell C4. So far I
have been trying to use the following, but it is not
working...

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\user\My documents\"
& "ActiveWorkbook.WorkSheet("Sheet1").Cells(3, 4)"
& ".xls",

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default *复: SaveAs

ActiveWorkbook.SaveAs "C:\Documents and Settings\user\My documents\" & "ActiveWorkbook.WorkSheet("Sheet1").Cells(3, 4)" & ".xls"
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
SaveAs - VBA Jae[_3_] Excel Discussion (Misc queries) 4 April 10th 08 08:10 PM
SaveAs Stan Halls Excel Worksheet Functions 5 November 28th 06 07:51 PM
saveas Nikita Excel Programming 1 September 17th 03 02:39 AM
SaveAs Darrin Henry Excel Programming 0 September 12th 03 10:09 PM
SaveAs Dave Peterson[_3_] Excel Programming 1 September 12th 03 12:44 AM


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