• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

personal workbook

Dheeraj

Member
Hi All,


Whenever we open an Excel Workbook, in backend another workbook named personal.xlsx opens. Kindly help me to find its path using VBA and make it visible so that I can save my VBA codes in its module so that they are available to me all the time.


Thanks and regards,

DJ
 
Hi Narayank991,


Thank you so much for the link, however there is a one line code that we can write in immediate code to get this path. I am actually looking for that.


Also, I want to add this workbook in Explorer Window so save my codes and make it available all the time.


Thanks,

Dheeraj
 
Hi Dheeraj ,


The following statement will do :


Msgbox Workbooks("personal.xlsb").Path


If you get an error message , try out the extensions .xlsx , .xlsm and , as a last resort , .xls


If you do not get the path using any of the above extensions , I don't think you have a personal.xls* file.


Narayan
 
Dear Narayan,


It seems that I did not explained my question clearly. Let me explain it again.


Whenever we open any excel workbook, MS Excel opens another excel file in the backend. The name of that file is Personal.xls. This workbook is hidden and so we are unable to view it.


However, we can find the path of this file by typing one liner code in immediate window. Also, we can add this file in Project Explorer Window so that any module that we save in this workbook is available to us all the time.


One of my colleague in my previous organization had told me this and did this practically however, I have forgotten it now. I am unable to contact him.


I have posted a screen shot of Code Window for your reference at the following link. I took this screen shot using my Personal Laptop. I want same on my office Laptop as well.


https://skydrive.live.com/#cid=026B2D6B6519A9D7&id=26B2D6B6519A9D7!107


Thanks,

Dheeraj
 
Hi, Dheeraj!

I previously read your post and NARAYANK991 suggestion, and I agree with him, the MsgBox statement will show you the path.

Looking at your posted image the issue is the personal workbook name: replace ".xlsb" by ".xls" in the MsgBox statement and it will work.

Regards!
 
Hi SirJB7,


I searched it on google now. The code that I needed was ?Application.StartupPath. Other details are available at http://www.rondebruin.nl/personal.htm.


Thanks,

Dheeraj
 
Hi, Dheeraj!

It's the same, different approach, but both methods work.

Give a look at this, it's my computer screen:

https://dl.dropbox.com/u/60558749/personal%20workbook%20%28for%20Dheeraj%20at%20chandoo.org%29.png

Regards!
 
Back
Top