Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to create a macro that will save my file in another location each
month. On of the variables is a folder in the pathname. For some reason, I can't get it to accept my variable. Here's my example MyValue = InputBox("Enter Month # ____ YYYY_MM", "Central Analytics") Windows("MPA Internal.xls").Activate ActiveWorkbook.SaveAs Filename:= _ "I:\EXLDATA\Loan Recovery MIS\" & MyValue & "\Outstandings\MPA Internal.xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False I've tried \MyValue\ " & MyValue & " " MyValue " &MyValue& nothings working... Help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
what error do you get for this code? -- Regards Frank Kabel Frankfurt, Germany "StephanieH" schrieb im Newsbeitrag ... I'm trying to create a macro that will save my file in another location each month. On of the variables is a folder in the pathname. For some reason, I can't get it to accept my variable. Here's my example MyValue = InputBox("Enter Month # ____ YYYY_MM", "Central Analytics") Windows("MPA Internal.xls").Activate ActiveWorkbook.SaveAs Filename:= _ "I:\EXLDATA\Loan Recovery MIS\" & MyValue & "\Outstandings\MPA Internal.xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False I've tried \MyValue\ " & MyValue & " " MyValue " &MyValue& nothings working... Help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try creating the whole filename as a string variable, and then using that
variable in the SaveAs command, rather than doing the string concatenation in the SaveAs command. "StephanieH" wrote: I'm trying to create a macro that will save my file in another location each month. On of the variables is a folder in the pathname. For some reason, I can't get it to accept my variable. Here's my example MyValue = InputBox("Enter Month # ____ YYYY_MM", "Central Analytics") Windows("MPA Internal.xls").Activate ActiveWorkbook.SaveAs Filename:= _ "I:\EXLDATA\Loan Recovery MIS\" & MyValue & "\Outstandings\MPA Internal.xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False I've tried \MyValue\ " & MyValue & " " MyValue " &MyValue& nothings working... Help. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm guessing that it isn't your code that's the problem.
Are you sure that this folder exists? "I:\EXLDATA\Loan Recovery MIS\" & MyValue & "\Outstandings" === What does the user type into that inputbox? And what do you expect? If I type 2, do you need 02? StephanieH wrote: I'm trying to create a macro that will save my file in another location each month. On of the variables is a folder in the pathname. For some reason, I can't get it to accept my variable. Here's my example MyValue = InputBox("Enter Month # ____ YYYY_MM", "Central Analytics") Windows("MPA Internal.xls").Activate ActiveWorkbook.SaveAs Filename:= _ "I:\EXLDATA\Loan Recovery MIS\" & MyValue & "\Outstandings\MPA Internal.xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False I've tried \MyValue\ " & MyValue & " " MyValue " &MyValue& nothings working... Help. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|