#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default MyValue

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default MyValue

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default MyValue

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default MyValue

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
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



All times are GMT +1. The time now is 03:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"