Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Changing Path for SaveAs Functions

Hello
I am trying to write code that automatically saves a file. Everything works
fine until I copy and paste the file in another folder. When the macro saves
the file it automatically defaults to the original location (where the code
was originally written)and not the folder in which it is currently in.
How do I change this, without being specific to a drive or folder?

I have posted 1 other time in the past and the help i recieved was right on,
first time. I appreciate any help I can get.

Thanks in advance,
--
Rick B
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Changing Path for SaveAs Functions

Post the macro for us to see.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Rick B" wrote in message
...
Hello
I am trying to write code that automatically saves a file. Everything
works
fine until I copy and paste the file in another folder. When the macro
saves
the file it automatically defaults to the original location (where the
code
was originally written)and not the folder in which it is currently in.
How do I change this, without being specific to a drive or folder?

I have posted 1 other time in the past and the help i recieved was right
on,
first time. I appreciate any help I can get.

Thanks in advance,
--
Rick B



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Changing Path for SaveAs Functions

Thanks Bob,
Here is all the code that I am using.
__________________________________________________ _____________________
Sub SetupPO()
'
' SetupPO Macro
' Macro recorded 10/11/2007 by Rick B
'

'This macro works to open the template, label it and save it correctly. Do
not change it.

Workbooks.Open Filename:="G:\ACTIVE CONTRACTS\Job setup\Purchase
Orders\P.O. & Sub\New PO.xls", UpdateLinks:=3
Windows("P.O. Log.xls").Activate
ActiveCell.Offset(0, -2).Range("A1").Select
Selection.Copy
Windows("New PO.xls").Activate
Range("F13").Select
'ActiveCell.Offset(-4, -8).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("P.O. Log.xls").Activate
ActiveCell.Offset(0, 1).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
Windows("New PO.xls").Activate
Range("C16").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("N17").Select
ActiveWorkbook.SaveAs Filename:=ActiveCell.Text, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
Range("I13").Select

End Sub
-----------------------------------------------------------------------------------------------------------
Cell reference "N17" contains the basic file name that this file is being
named as. It does not however contain the full path of the new file.
I hope this helps.
--
Rick B


"Bob Phillips" wrote:

Post the macro for us to see.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Rick B" wrote in message
...
Hello
I am trying to write code that automatically saves a file. Everything
works
fine until I copy and paste the file in another folder. When the macro
saves
the file it automatically defaults to the original location (where the
code
was originally written)and not the folder in which it is currently in.
How do I change this, without being specific to a drive or folder?

I have posted 1 other time in the past and the help i recieved was right
on,
first time. I appreciate any help I can get.

Thanks in advance,
--
Rick B




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
changing the path behind a button derksj Excel Discussion (Misc queries) 1 September 11th 08 01:58 PM
Macro path follows the "SaveAs" file OlieH Excel Programming 1 March 3rd 07 01:50 AM
SaveAs File Path Method kartune85 Excel Programming 1 June 20th 06 07:56 AM
Changing the Path In a Usage Log Red[_3_] Excel Programming 12 November 16th 04 03:57 PM
SaveAs and relative path dev[_2_] Excel Programming 2 December 19th 03 02:50 PM


All times are GMT +1. The time now is 07:46 AM.

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"