문제

I have a macro in my excel and when I use .SaveAs in said macro, it automatically saves the file in my documents (when I dont specify a path)

I really dont want to specify a path, I just want it to save the resulting file in the directoy where excel book is.

heres the save code:

    fnameandpath = InputBox("Please Enter A New File Name")
    If fnameandpath = Empty Then
        'warn user

    Else  
        ActiveWorkbook.SaveAs fnameandpath
        Range("A1").Activate
    End If

so for example, I put my excel file on my desktop. I enter in "TestFile" when the box pops, then I get an xlsm file in my documents rather than on my desktop. Why? Can I change that default behavior? the msdn says it saves to the current location.

도움이 되었습니까?

해결책

not that anyone is ever going to look at this but, there is indeed a default save path in excel. for 2010 anyways its options - save - default file location. the default is the documents folder.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top