Posts by IanDunnett

    Re: Renaming FIles without saving


    The problem is that Ican't save it as I cabn't guarantee that any filepath on another user's computer is going to exist, and we don't have authority to write to our own C drives, so I really need to name the file without saving it.


    Thanks for the ideas so far though...keep them coming.

    Open Question:


    I am trying to name a file and send via Outlook without having to save the file.


    For example if you open a new Book and it is automatically named Book2.xls, can you rename this without saving it anywhere before attaching to an Outlook e-mail through a macro?


    I am happy with the Outlook coding but can't get it to rename without saving as well. The problem is that the program is for multiple users across a network and I can't guarantee they are going to the same file path avaiable as anyone else or necessarily have enough room to save it.


    Is this possible?


    Any help appreciated.


    Cheers.

    Re: Remove Filename extensions


    Thanks for the replies guys, although we fixed the problem by going the below route...


    ActiveWorkbook.SaveAs Filename:=filenamex, FileFormat:= _
    xlCSV, CreateBackup:=False
    ActiveWindow.Close
    Windows("PKLoad_Template.xls").Activate


    FileCopy "S:\HRBW-510\" & filenamex & ".csv", "S:\HRBW-510\" & filenamex


    Kill "S:\HRBW-510\" & filenamex & ".csv"

    Re: Remove Filename extensions


    Hey everyone.


    Interesting trail here, although I need a method of saving a file from Excel VBA without an extension, I keep coming aground as the SaveAs in VBA requires a file type to avoid a syntax error.


    Is there any way around this or is there a way to rename the file in the drive it is saved to from an Excel Macro, i.e. save it as a .xls, then rename the saved file rather than the workbook?


    Thanks in advance,


    Ian