L
Logan
I'm having two problems with this Save As macro
Sub Save_As()
Dim FName1, FName2, FName3, Fullname
FName1 = "CK0"
FName2 = Range("AU2").Value & "-"
FName3 = Range("J4").Value
Fullname = FName1 & FName2 & FName3
Application.DisplayAlerts = False
ChDir "G:\New"
ActiveWorkbook.SaveAs Fullname, FileFormat _
:=xlNormal, CreateBackup:=False
MsgBox "Saved to " & CurDir
End Sub
Problem one is that the ChDir command won't force it to go
to the 'G' drive it saves it in My Documents. I've gone
into Tools/Options and change the default setting to 'G'
and that works, but I didn't think I should have to do
that, I thought the CHDir command would do that for me.
The second problem is that I placed a custom macro command
on my toolbar to run the macro. Problem is when I try to
use it, it says with the name"The last file name I just
saved" is already open.
It seems like it is recalling the last saved document.
If I just go tools macro and run it that way it works fine.
Any ideas??
Sub Save_As()
Dim FName1, FName2, FName3, Fullname
FName1 = "CK0"
FName2 = Range("AU2").Value & "-"
FName3 = Range("J4").Value
Fullname = FName1 & FName2 & FName3
Application.DisplayAlerts = False
ChDir "G:\New"
ActiveWorkbook.SaveAs Fullname, FileFormat _
:=xlNormal, CreateBackup:=False
MsgBox "Saved to " & CurDir
End Sub
Problem one is that the ChDir command won't force it to go
to the 'G' drive it saves it in My Documents. I've gone
into Tools/Options and change the default setting to 'G'
and that works, but I didn't think I should have to do
that, I thought the CHDir command would do that for me.
The second problem is that I placed a custom macro command
on my toolbar to run the macro. Problem is when I try to
use it, it says with the name"The last file name I just
saved" is already open.
It seems like it is recalling the last saved document.
If I just go tools macro and run it that way it works fine.
Any ideas??