Consulting

Results 1 to 2 of 2

Thread: Saving a Worksheet

  1. #1

    Saving a Worksheet

    Hi guys,

    I have the following VBA code
    [vba]ActiveWorkbook.SaveAs Filename:=myfilepath & "Saved Assessments\Both Assessments\" & fileSaveName & ".xls"[/vba]
    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...

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It is very hard to say without knowing what is in myfilepath, but maybe

    [vba]

    ActiveWorkbook.SaveAs Filename:=myfilepath & "\Saved Assessments\Both Assessments\" & fileSaveName & ".xls"
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •