#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default vba autosave

Hi,
how do I get this to save the file to specific location, it just keeps going
to my documents.

Public Sub SaveAsE5()
ThisFile = Range("E5").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default vba autosave

Option Explicit
Public Sub SaveAsE5()
Dim ThisFile as string
Dim myPath as string

myPath = "C:\your path here"
if right(mypath,1) < "\" then
mypath = mypath & "\"
end if

ThisFile = Activesheet.Range("E5").Value
ActiveWorkbook.SaveAs Filename:=mypath & ThisFile
End Sub

totally lost wrote:

Hi,
how do I get this to save the file to specific location, it just keeps going
to my documents.

Public Sub SaveAsE5()
ThisFile = Range("E5").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default vba autosave

Define Specific Location. You could put the full path and file name in the
cell. You could hard code a path in the procedule like this...

Public Sub SaveAsE5()
thisWorkbook.SaveAs C:\WhereEver\ & Sheets("Sheet1").Range("E5").Value
End Sub

or in the same directory as the existing workbook

Public Sub SaveAsE5()
with thisWorkbook
.SaveAs .path & "\" & Sheets("Sheet1").Range("E5").Value
end with
End Sub
--
HTH...

Jim Thomlinson


"totally lost" wrote:

Hi,
how do I get this to save the file to specific location, it just keeps going
to my documents.

Public Sub SaveAsE5()
ThisFile = Range("E5").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub

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
AutoSave juanpablo Excel Discussion (Misc queries) 3 October 6th 07 01:52 PM
AutoSave.xla Add-in Maycon Setting up and Configuration of Excel 3 July 1st 06 12:50 AM
Opened Autosave but when closing workbook Autosave closes itself Ken Excel Worksheet Functions 0 October 29th 05 05:11 PM
Autosave rashid munawar Excel Discussion (Misc queries) 1 September 7th 05 01:30 PM
AutoSave Tee Excel Discussion (Misc queries) 4 August 11th 05 12:43 PM


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