I
Ira
I have run time error 1004 while running a macro. It says Microsoft Office
Excel can not access the file. But file is there. Is anuthing wrong in the
code?
OutputFile = "C:\users\hz7fff\Desktop\Monthly Settlement\Monthly Output
Files\"
Report_Workbook = ActiveWorkbook.Name
If (Left(Report_Workbook, 11) = "Settlement ") Then
ActiveWorkbook.Names.Add Name:="Settlement_Data", RefersToR1C1:= _
"='Monthly Settlement Statement'!C1:C8"
ActiveWorkbook.Names.Add Name:="Copy_Row", RefersToR1C1:= _
"='Monthly Settlement Statement'!RC1,'Monthly Settlement
Statement'!RC2,'Monthly Settlement Statement'!RC4,'Monthly Settlement
Statement'!RC8"
Range("A1").Select
'
Message = "Enter the year and month for the data just processed in
YYYYMM format."
Title = "FileName"
Data_Date = InputBox(Message, Title)
'
Save_File = "Settlement " & Left(Data_Date, 4) & "-" & Right(Data_Date,
2) & ".xls"
Save_FullName = OutputFile & Save_File
''''''''''''''''''''''''''''''''''''''It stops here
ActiveWorkbook.SaveAs Filename:= _
Save_FullName, FileFormat:=xlNormal, Password:="",
WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
'''''''''''''''''''''''''''''''Please help!
Excel can not access the file. But file is there. Is anuthing wrong in the
code?
OutputFile = "C:\users\hz7fff\Desktop\Monthly Settlement\Monthly Output
Files\"
Report_Workbook = ActiveWorkbook.Name
If (Left(Report_Workbook, 11) = "Settlement ") Then
ActiveWorkbook.Names.Add Name:="Settlement_Data", RefersToR1C1:= _
"='Monthly Settlement Statement'!C1:C8"
ActiveWorkbook.Names.Add Name:="Copy_Row", RefersToR1C1:= _
"='Monthly Settlement Statement'!RC1,'Monthly Settlement
Statement'!RC2,'Monthly Settlement Statement'!RC4,'Monthly Settlement
Statement'!RC8"
Range("A1").Select
'
Message = "Enter the year and month for the data just processed in
YYYYMM format."
Title = "FileName"
Data_Date = InputBox(Message, Title)
'
Save_File = "Settlement " & Left(Data_Date, 4) & "-" & Right(Data_Date,
2) & ".xls"
Save_FullName = OutputFile & Save_File
''''''''''''''''''''''''''''''''''''''It stops here
ActiveWorkbook.SaveAs Filename:= _
Save_FullName, FileFormat:=xlNormal, Password:="",
WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
'''''''''''''''''''''''''''''''Please help!