Save As Method

  • Ok I am trying to copy some code from the Excel help directory but I am getting an error saying "Compile Error, Can't find project or library".


    What am I missing here?


    Code
    fileSaveName = Application.GetSaveAsFilename( _
        fileFilter:="Excel Files (*.xls), *.xls")
    If fileSaveName <> False Then
        MsgBox "Save as " & fileSaveName
    End If
  • Re: Save As Method


    I tried your code using Excel 2003 and it worked fine!, if you are using Excel 2003 i suggest you re-install (well at least the library and help files).


    Regards,
    Simon

  • Re: Save As Method


    So how would I reinstall the library? Thing is, IT installed Office on each workstation and getting something done by our IT department is like getting hell to freeze over, aint happening.


    So is there something I can do within Excel to get the library installed?

  • Re: Save As Method


    Quote from Username99

    So how would I reinstall the library? Thing is, IT installed Office on each workstation and getting something done by our IT department is like getting hell to freeze over, aint happening.


    So is there something I can do within Excel to get the library installed?


    Unfortunately you probably wont have the rights to install adapt or update your version of office even if you had the office professional disk!................therefore please wait quietly for hell to freeze!


    Regards,
    Simon


    P.S they usually have the whole of foffice stored in a location on a network server from which the update or install!

  • Re: Save As Method


    What about adding references? I see it lists different types of libraries which I can click and add multiple references but not sure which one I need or if that is what I'm looking for.

  • Re: Save As Method


    Quote from Username99

    What about adding references? I see it lists different types of libraries which I can click and add multiple references but not sure which one I need or if that is what I'm looking for.


    Are any references marked as MISSING?

  • Re: Save As Method


    In my libraries and references i have the following checked (and im on a network!) Visual Basic For Applications, Microsoft Excel 11.0 Object Library, OLE Automation and Microsoft Office 11.0 Object Library,if these are checked then you need a new install or repair.......and it will have to be IT!


    regards,
    Simon

  • Re: Save As Method


    So is there any other way to create a new excel file with a differnet name? I would normally go to Save As and then give a name but would rather have it as some code.


    Suggestions?

  • Re: Save As Method


    This activated by keyboard shortcut or comand button would do the trick


    Code
    Sub SvWbook()
    Dim T1
    T1 = InputBox("Enter your Save As Name", "Workbook Saver")
    ActiveWorkbook.SaveAs T1 & ".xls"
    End Sub

    regards,
    Simon

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!