MrExcel Publishing
Your One Stop for Excel Tips & Solutions


Posted by Jonathan on March 07, 2001 1:59 PM

I have the following code:
Sheets("WTD VDN Call Detail").Select
Sheets("Day VDN Call Detail").Select
Workbooks.OpenText FileName:="O:\Force Management\Center Daily Summary\Master Center Daily Summary.xls"
Sheets(Day(Now) - 1).Activate
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False, _
Application.Workbooks("VOW " & FORMAT((Date) - 1, "mm-dd-yy") & ".xls").Activate

When i try and run it, it highlightes the word "FORMAT" and says
"Compile Error:
Wrong Number of arguments or invalid property assignments"

As I was writing this I was testing it and it worked. when i closed out and came back in to try it, this is what it told me. Help Please.

Posted by ml on March 07, 2001 2:03 PM

Try replacing with:

Workbooks("VOW " & application.text((Date)-1,"mm-dd-yy") & ".xls").activate

Isn't Date a function? Or were you writing that generically as
some variable holding a date?