none
In an Excel template file, can I get the Folder Path RRS feed

  • Question

  •  it works fine to get path by workbook  fullname property in xls, xlsx files.

    but, what can i do in template files

    Friday, September 9, 2016 7:20 AM

Answers

  • Hi Walt.Li,

    method is already described above.

    when you create a new file at that time file is not saved on the disk its just in the memory.

    so if you execute Workbook.Fullname or workbook.path at that time then path is not available. because file is not available on the disk. so there is nothing to show. because of this reason it returns nothing.

    after saving the file. file has a location on the disk. so if you execute the .Fullname or .path then you will get the fullname and path.

    Hope it will clear the misunderstanding.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Walt.Li Tuesday, September 13, 2016 2:10 AM
    Monday, September 12, 2016 7:40 AM
    Moderator

All replies

  • Hi WaltLi,

    your description of the thread is little confusing.

    As I understand you want to say that you are able to get the path of XLS and Xlsx file using ActiveWorkBook.Fullname.

    but you don't know how to get the path from the Excel Template file.

    so with the same line of code you can get the path of Template file also.

    you need to create Macro enabled Template. so that you can execute your macro.

    also you can try to use

    ActiveWorkbook.Path 
    
     or
     
    CurDir()
    
    
    
     

    for more information you can try to visit the link mentioned below.

    Workbook.FullName Property (Excel)

    CurDir Function

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 9, 2016 9:29 AM
    Moderator
  • yes, that's my question.

    i did in com add-in. Already tried "Path" "FullName""Name", but all failed

     
    Monday, September 12, 2016 3:29 AM
  • Hi Walt.Li,

    I test it on my side with Addin and I find that when we use Activeworkbook.fullname or Activeworkbook.path it will return nothing or return only the name of file when the file is not saved and newly created.

    so to get the path from Addin you need to open the already saved file and test it.

    it will return both fullname and path.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 12, 2016 5:05 AM
    Moderator
  • so  it means there is no method to get template file path
    Monday, September 12, 2016 6:56 AM
  • Hi Walt.Li,

    method is already described above.

    when you create a new file at that time file is not saved on the disk its just in the memory.

    so if you execute Workbook.Fullname or workbook.path at that time then path is not available. because file is not available on the disk. so there is nothing to show. because of this reason it returns nothing.

    after saving the file. file has a location on the disk. so if you execute the .Fullname or .path then you will get the fullname and path.

    Hope it will clear the misunderstanding.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Walt.Li Tuesday, September 13, 2016 2:10 AM
    Monday, September 12, 2016 7:40 AM
    Moderator
  • it's absolutely clear.

    thx.

    Tuesday, September 13, 2016 2:10 AM