Subroutine aborting unexpectedly, no error

Asator

Board Regular
Joined
Apr 5, 2010
Messages
186
Rich (BB code):
Sub ShowDeltaCalcWork(UpdatedPartArray() As Variant, CMBook As Workbook, zsdprcbook As Workbook)
Dim showwk As Worksheet
Dim bfilesheet As Worksheet
Dim commcalc As Worksheet
Dim bfrng As Range
Dim bfrows As Integer
Set showwk = CMBook.Sheets("PartCalc")
Set bfilesheet = CMBook.Sheets("Bfile_data")
Set commcalc = CMBook.Sheets("Bfile calculation")

MsgBox bfilesheet.Cells(Rows.Count, 1).End(xlUp).Row <--- this works, displays the correct value (49,000 or so)

bfrows = bfilesheet.Cells(Rows.Count, 1).End(xlUp).Row

MsgBox bfilesheet.Cells(Rows.Count, 1).End(xlUp).Row <--- this never appears, nothing after it runs, tried replacing it with bfrows
With bfilesheet
    Set bfrng = .Range(.Cells(1, 1), .Cells(bfrows, 7))
End With
 
...insert a bunch of other code below

The macro goes on to the other subroutines to create pivot tables based on other data. I really can't understand why this subroutine would quit without giving any errors. Any ideas?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Do you have an error handler enabled in the procedure that calls ShowDeltaCalcWork? If the row is 49000 bfrows should be declared as Long.
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,310
Members
452,906
Latest member
phanmemchatdakenhupviral

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