Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Save as marco

I am trying to create a macro that will first save the file and then second
save as to a new location and new file name.

Here is what I have and it doesn't work after the first save.

Sub autosave()
ActiveWorkbook.Save
ChDir "R:\"
ActiveWorkbook.SaveAs Filename:="R:\Service.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

I tried it with and without the ChDir "R:\" and that did not work either.

I also tried just

ActiveWorkbook.SaveAs Filename:="R:\Service.xls"

and that also did not work.

Thank you for any and all help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Save as marco

Try changing your path to c:\temp ...and if that is working. check the folder
rights in R:\

Sub autosave()
Dim strFileName as String
strFileName = "R:\service.xls"
ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename:=strFileName
End Sub


--
If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

I am trying to create a macro that will first save the file and then second
save as to a new location and new file name.

Here is what I have and it doesn't work after the first save.

Sub autosave()
ActiveWorkbook.Save
ChDir "R:\"
ActiveWorkbook.SaveAs Filename:="R:\Service.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

I tried it with and without the ChDir "R:\" and that did not work either.

I also tried just

ActiveWorkbook.SaveAs Filename:="R:\Service.xls"

and that also did not work.

Thank you for any and all help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Save as marco

I changed the path to "C:\temp\servive.xls" and it still did not work.

I keep getting the code exexution has been interrupted box

"Jacob Skaria" wrote:

Try changing your path to c:\temp ...and if that is working. check the folder
rights in R:\

Sub autosave()
Dim strFileName as String
strFileName = "R:\service.xls"
ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename:=strFileName
End Sub


--
If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

I am trying to create a macro that will first save the file and then second
save as to a new location and new file name.

Here is what I have and it doesn't work after the first save.

Sub autosave()
ActiveWorkbook.Save
ChDir "R:\"
ActiveWorkbook.SaveAs Filename:="R:\Service.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

I tried it with and without the ChDir "R:\" and that did not work either.

I also tried just

ActiveWorkbook.SaveAs Filename:="R:\Service.xls"

and that also did not work.

Thank you for any and all help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Save as marco

You must be trying with a read-only file. Ignore save and go with Save As

'ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename:=strFileName


--
If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

I changed the path to "C:\temp\servive.xls" and it still did not work.

I keep getting the code exexution has been interrupted box

"Jacob Skaria" wrote:

Try changing your path to c:\temp ...and if that is working. check the folder
rights in R:\

Sub autosave()
Dim strFileName as String
strFileName = "R:\service.xls"
ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename:=strFileName
End Sub


--
If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

I am trying to create a macro that will first save the file and then second
save as to a new location and new file name.

Here is what I have and it doesn't work after the first save.

Sub autosave()
ActiveWorkbook.Save
ChDir "R:\"
ActiveWorkbook.SaveAs Filename:="R:\Service.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

I tried it with and without the ChDir "R:\" and that did not work either.

I also tried just

ActiveWorkbook.SaveAs Filename:="R:\Service.xls"

and that also did not work.

Thank you for any and all help.

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
Help with this marco JBoyer Excel Programming 4 August 2nd 08 04:23 AM
Marco To Save Column A7 As A .txt File. Chris Excel Worksheet Functions 11 May 30th 08 10:20 AM
How: Marco on Pivot Table to save as file up to 300 files [email protected] Excel Programming 4 May 7th 08 06:19 PM
save file via Marco Tom Excel Programming 4 July 26th 04 01:29 PM
marco David Kuehl Excel Programming 4 September 18th 03 11:37 PM


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