PC Review


Reply
Thread Tools Rate Thread

Changing Path for SaveAs Functions

 
 
Rick B
Guest
Posts: n/a
 
      27th Nov 2007
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      27th Nov 2007
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" <(E-Mail Removed)> wrote in message
news:522E808E-CDF4-434B-AB7D-(E-Mail Removed)...
> 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 With Quote
 
Rick B
Guest
Posts: n/a
 
      27th Nov 2007
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" <(E-Mail Removed)> wrote in message
> news:522E808E-CDF4-434B-AB7D-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to specify path when using SaveAs ? Jack Microsoft Excel Programming 2 4th Oct 2008 01:29 PM
SaveAs using Hyperlink/Path in a cell SJW_OST Microsoft Excel Programming 1 27th Aug 2008 10:53 AM
SaveAs Path rla Microsoft Outlook VBA Programming 0 21st Jun 2006 09:24 PM
SaveAs File Path Method kartune85 Microsoft Excel Programming 1 20th Jun 2006 07:56 AM
SaveAs and relative path dev Microsoft Excel Programming 2 19th Dec 2003 02:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:08 AM.