• 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.

Can some find and open this Personal.XLSB

Hello,

I has this procedure code call SafelyQuit down Personal.XLSB. I can not find the Personal.XLSB when the application is running. Here is the code segment below. Can someone find the Personal.XLSB for me and explain what is doing. Thanks in advance.


Public Function SafelyQuit() As Boolean
Dim wb As Workbook, wbn As String, cwb As String
Application.EnableEvents = False
cwb = ThisWorkbook.Name
SafelyQuit = True
For Each wb In Workbooks
wb.Activate
wbn = ActiveWorkbook.Name
If wbn <> cwb And UCase(wbn) <> "PERSONAL.XLSB" Then
SafelyQuit = False
Exit Function
End If
Next
End Function
 

Attachments

  • cpjrDev_WorkBook_ver3.2.xls
    533 KB · Views: 1
Hi Clarence

The above procedure is linked to this procedure

Sub DoExitNow()

Which calls your function SafelyQuit. Which is linked to the Red Button (Exit Application)

It effectively just closes the workbook cprjDev.

It will keep all workbooks open including your personal macro workbook.

I think it is a little overly complex to be hones. I think the procedure should be called DoExitNow

and the activeline of code should be

Activeworkbook.close false

which is close don't save, replace false with true for save and you have shut the workbook safely and saved yourself a lot of hassle with your coding.

Anyways I hope that helps more than confuses.

Smallman
 
Hi Clarence

The above procedure is linked to this procedure

Sub DoExitNow()

Which calls your function SafelyQuit. Which is linked to the Red Button (Exit Application)

It effectively just closes the workbook cprjDev.

It will keep all workbooks open including your personal macro workbook.

I think it is a little overly complex to be hones. I think the procedure should be called DoExitNow

and the activeline of code should be

Activeworkbook.close false

which is close don't save, replace false with true for save and you have shut the workbook safely and saved yourself a lot of hassle with your coding.

Anyways I hope that helps more than confuses.

Smallman
When I look at this code below where is this PERSONAL.XLSB located within the application? How is this thing call PERSONAL.XLSB being used in this application.

Public Function SafelyQuit() As Boolean
Dim wb As Workbook, wbn As String, cwb As String
Application.EnableEvents = False
cwb = ThisWorkbook.Name
SafelyQuit = True
For Each wb In Workbooks
wb.Activate
wbn = ActiveWorkbook.Name
If wbn <> cwb And UCase(wbn) <> "PERSONAL.XLSB" Then
SafelyQuit = False
Exit Function
End If
Next
End Function
 
When I look at this code below where is this PERSONAL.XLSB located within the application? How is this thing call PERSONAL.XLSB being used in this application.

Public Function SafelyQuit() As Boolean
Dim wb As Workbook, wbn As String, cwb As String
Application.EnableEvents = False
cwb = ThisWorkbook.Name
SafelyQuit = True
For Each wb In Workbooks
wb.Activate
wbn = ActiveWorkbook.Name
If wbn <> cwb And UCase(wbn) <> "PERSONAL.XLSB" Then
SafelyQuit = False
Exit Function
End If
Next
End Function
Hi Clarence

The above procedure is linked to this procedure

Sub DoExitNow()

Which calls your function SafelyQuit. Which is linked to the Red Button (Exit Application)

It effectively just closes the workbook cprjDev.

It will keep all workbooks open including your personal macro workbook.

I think it is a little overly complex to be hones. I think the procedure should be called DoExitNow

and the activeline of code should be

Activeworkbook.close false

which is close don't save, replace false with true for save and you have shut the workbook safely and saved yourself a lot of hassle with your coding.

Anyways I hope that helps more than confuses.

Smallman
How can I get to see this personal macro workbook. I need see what it is doing? I did not create the personal macro workbook. Are you able to see the personal macro workbook. If you are can you give me direction on how I can open the personal macro workbook.
 
If you don't have a PMW hit record new macro - choose the personal macro wb as the source from the drop down and now perform an action, select a cell etc. Now press alt f11. Your PMB will now be on the vbe explorer window to the left. It will have the macro you just recorded. I don't use a PMB. It is handy when you are starting and have loads to remember and need to store stuff that your brain won't remember.

Take care

Smallman
 
If you don't have a PMW hit record new macro - choose the personal macro wb as the source from the drop down and now perform an action, select a cell etc. Now press alt f11. Your PMB will now be on the vbe explorer window to the left. It will have the macro you just recorded. I don't use a PMB. It is handy when you are starting and have loads to remember and need to store stuff that your brain won't remember.

Take care

Smallman
Did you see this Personal.xslb file in the file that I posted on the site. When I look in the vbe explorer window, I do not see a Personal.xslb file. Can this file be hidden from a user. I am trying to determine where this macro is and what it has in it.
 
Clarence

You made me laugh. Thanks.

You don't understand. It is just saying don't close the personal macro workbook. It doesn't matter if you have one or not.

That file does not come with a PMW. It is unique to each user. You can't send me your PMB or anyone else for that matter (not strictly true as I could replace mine with yours if you emailed it to me). But other than that action the PMW are unique to each user.

You have it all wrong. You need to clue up on what a PMW is how it is used and trust that the code you posted does not invoke any action on the PMW.

Take care

Smallman
 
Did you see this Personal.xslb file in the file that I posted on the site. When I look in the vbe explorer window, I do not see a Personal.xslb file. Can this file be hidden from a user. I am trying to determine where this macro is and what it has in it.
Did you see this Personal.xslb file in the file that I posted on the site. When I look in the vbe explorer window, I do not see a Personal.xslb file. Can this file be hidden from a user. I am trying to determine where this macro is and what it has in it.
I attempted the below commands. But, I saw nothing in the folder. I am not sure why it is in the code.

1) Open excel
2) Hit alt-F11 to get to the VBE
3) Hit ctrl-g to see the immediate window and type this:
4) ?Application.StartupPath
5) Press enter
You’ll see the startup path returned for the PC.
 
Clarence

You made me laugh. Thanks.

You don't understand. It is just saying don't close the personal macro workbook. It doesn't matter if you have one or not.

That file does not come with a PMW. It is unique to each user. You can't send me your PMB or anyone else for that matter (not strictly true as I could replace mine with yours if you emailed it to me). But other than that action the PMW are unique to each user.

You have it all wrong. You need to clue up on what a PMW is how it is used and trust that the code you posted does not invoke any action on the PMW.

Take care

Smallman
I get it now and thank for helping me to understand this more.
 
Oh - are you trying to find the PMW file location? That is a different question to can you look at this bit of code and tell me what it is doing (see post 1). Now I am very confused. What are you trying to achieve from this thread Clarence?
 
Oh - are you trying to find the PMW file location? That is a different question to can you look at this bit of code and tell me what it is doing (see post 1). Now I am very confused. What are you trying to achieve from this thread Clarence?
You answer the question before I posted this reply. I am good with your explanation of the PMW.

Thanks
 
Back
Top