Workbook crashes

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,074
Office Version
  1. 2019
Platform
  1. Windows
After adding a label to a userform, my workbook crashes. After stepping through the code, I realize anything with lbChart.Visible... is the cause of the crash. I decided to copy and paste existing label already on the userform and the workbook continues to crash. When I delete the label and add a new label, no crash occurs, however, after saving and closed and restarting, the crash occurs. I decided to commented out coding with lbChart.Visible... but keep the label on the userform and NO crash occurs. Can anyone offer a diagnoses to this problem.

Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi,

Please share the macro to check the issue.

Thanks,
Saurabh
 
Upvote 0
VBA Code:
Private Sub lbChart_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
lbinternet.Visible = True
lbChart.Visible = False
ThisWorkbook.Unprotect Password:="Av8tordude!"
Me.Repaint
GetData2
lbinternet.Visible = False
ThisWorkbook.Protect Password:="Av8tordude!"
End Sub
 
Upvote 0
Hi,

Didn't find any issue in the code. I tried at my end and its working fine.

What GetData2 function have ?

Thanks,
Saurabh
 
Upvote 0
The GetData2 doesn't cause the crash. As mentioned before, I commented out lbChart.visible and the crash occurs. However, If I don't comment out lbChart.visible then the crash occurs.
 
Upvote 0
As the code is not creating any issue in my excel. It would be great if you share your sheet to check.
 
Upvote 0
Label is on a userform. The black arrow is pointing to the new label. it sits on top of Image object. the "Retrieving Data..." label also sits on top the image object, however, this label does not cause the workbook to crash. I did try copy/paste this label but it still causes the workbook to crash
 

Attachments

  • Label.png
    Label.png
    14.5 KB · Views: 4
  • Pref.png
    Pref.png
    14.5 KB · Views: 5
Upvote 0
Hi, I created the similar userform, added labels with same name, added the code but its working fine.

No crashing of workbook.

Sorry, unable to reproduce the issue.
 
Upvote 0
Hmmm...strange. I decided to remove the lbChart and rewrite the code using the "Retrieving data..." label. Two birds with one stone. Removed an object and less code, but efficient coding.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top