Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Save to a certain location

I'm having difficulties saving a file to a certain location.

My code is.

Sub closeappandsave()

Application.ScreenUpdating = False

servpath = "c:\my documents"

Period = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA1").Text
Week = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA2").Text

File = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("z6").Value

ThisWorkbook.SaveAs Filename:="servpath & " \ " & Period & " \ " & Week & "
\ " & File"

End Sub

Any help on getting this working would be appreciated.

Nick


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Save to a certain location

Variables should not have double quotes..

ThisWorkbook.SaveAs Filename:= servpath & "\" & Period & "\" & Week & "\" &
File

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


"N1KO" wrote:

I'm having difficulties saving a file to a certain location.

My code is.

Sub closeappandsave()

Application.ScreenUpdating = False

servpath = "c:\my documents"

Period = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA1").Text
Week = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA2").Text

File = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("z6").Value

ThisWorkbook.SaveAs Filename:="servpath & " \ " & Period & " \ " & Week & "
\ " & File"

End Sub

Any help on getting this working would be appreciated.

Nick


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Save to a certain location

Legend, been looking at it for hours now.

Thanks

"Jacob Skaria" wrote:

Variables should not have double quotes..

ThisWorkbook.SaveAs Filename:= servpath & "\" & Period & "\" & Week & "\" &
File

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


"N1KO" wrote:

I'm having difficulties saving a file to a certain location.

My code is.

Sub closeappandsave()

Application.ScreenUpdating = False

servpath = "c:\my documents"

Period = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA1").Text
Week = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA2").Text

File = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("z6").Value

ThisWorkbook.SaveAs Filename:="servpath & " \ " & Period & " \ " & Week & "
\ " & File"

End Sub

Any help on getting this working would be appreciated.

Nick


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Save to a certain location

Dear NIKO

Forgot to mention slash should be represented as "\" and not " \ " (with
spaces)..

Few more suggestions
1. Use Option Explicit
2. Declare variables
3. Use prefix for variables to reflect the type (str for String)

Option Explicit

Sub closeappandsave()
Dim strServerPath As String
Dim strPeriod As String
Dim strWeek As String
Dim strFile As String

Application.ScreenUpdating = False

strServerPath = "c:\my documents"
strPeriod = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA1").Text
strWeek = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA2").Text
strFile = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("z6").Value

ThisWorkbook.SaveAs Filename:= strServerPath & "\" & strPeriod & "\" &
strWeek & "\" & strFile

End Sub

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


"N1KO" wrote:

Legend, been looking at it for hours now.

Thanks

"Jacob Skaria" wrote:

Variables should not have double quotes..

ThisWorkbook.SaveAs Filename:= servpath & "\" & Period & "\" & Week & "\" &
File

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


"N1KO" wrote:

I'm having difficulties saving a file to a certain location.

My code is.

Sub closeappandsave()

Application.ScreenUpdating = False

servpath = "c:\my documents"

Period = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA1").Text
Week = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("AA2").Text

File = Workbooks("Flash Report
V1.0.xls").Worksheets("Summary").Range("z6").Value

ThisWorkbook.SaveAs Filename:="servpath & " \ " & Period & " \ " & Week & "
\ " & File"

End Sub

Any help on getting this working would be appreciated.

Nick


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
Macro - save to current location vs excel default location leezard Excel Discussion (Misc queries) 0 October 28th 08 03:04 PM
how to save the same file in other location ravscares Excel Discussion (Misc queries) 2 July 22nd 08 03:10 PM
default save location on network Steve_n_KC Excel Discussion (Misc queries) 1 August 23rd 07 01:38 AM
SAVE IN LOCATION gringolocoed Excel Worksheet Functions 1 August 11th 07 03:28 AM
Save to specific location LB79 Excel Discussion (Misc queries) 2 August 25th 05 11:02 AM


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