PDA

View Full Version : Saving a Worksheet



anthony20069
10-09-2009, 02:07 AM
Hi guys,

I have the following VBA code
ActiveWorkbook.SaveAs Filename:=myfilepath & "Saved Assessments\Both Assessments\" & fileSaveName & ".xls"
But when ever the button is click the following

"Run-time Erroe '1004'

Microsoft Office Excel cannot access the file 'file path'. there are several possible reasons:
- path doesnt exist
- path being used
- same name as another workbook"

Basically what i need it to do, is look at where the spreadsheet called "Assessment Application.xls" is located on the laptop, and there is a folder called Saved Assessments to which the file needs to be saved at....

Hope that makes sense...

xld
10-09-2009, 04:14 AM
It is very hard to say without knowing what is in myfilepath, but maybe



ActiveWorkbook.SaveAs Filename:=myfilepath & "\Saved Assessments\Both Assessments\" & fileSaveName & ".xls"