Thursday, July 30, 2009

Does anyone know about Excel Macros?

I've been up all night trying to get this to run. It highlights the File Format as Syntax Error





ActiveWorkbook.SaveAs Filename:= _


"C:\Invoices\" %26amp; Sheets("OCT 07").Range("A2").Value %26amp; " Mar 08 Invoice.xls"


, FileFormat:=xlExcel8,


Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _


CreateBackup:=False

Does anyone know about Excel Macros?
I think your problem is on this bit "Sheets("OCT 07").Range("A2").Value %26amp; " Mar 08 Invoice.xls"





You are creating a wierd filename starting with OCT 07 then adding in the contents of A2, no space, then Mar 08 Invoice.





Is that what you wanted?
Reply:I'm not expert ... but sometimes wing a little Excel VBA...





What version of XL?





I don't see xlExcel8 listed as a valid FileFormat constant for XL2K or XL03. Sorry my Xl07 PC is down so cannot check.





Why not save to the native format? Change the fileFormat constant to xlNormal. That works for me.





Post back if that doesn't work. I'll help you find it.

orange

No comments:

Post a Comment