Module fails when in break mode

stubarny

New Member
Joined
Apr 7, 2011
Messages
41
Hello All,

Please could someone explain why the following module breaks when in break mode (when each line run in turn using the F8 button) but when I run the macro out of break mode it is fine (in break mode it is failing on the last line shown below):

Code:
Sub Outputreport()
Application.DisplayAlerts = False
 
                 Rowno = 6
                 Do Until Cells(Rowno, 1) = ""
                  'Cells(Rowno, 1).Select
                  WkName = Cells(Rowno, 1).Value
 
                  SaveName = WkName & Cells(2, 3).Value
 
 
 Windows("ReportCreationMacro.xls").Activate
  Sheets("FunctionReports").Select
 
 
 
Selection.AutoFilter Field:=4, Criteria1:=WkName

Thanks,

Stu
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi Rory, this is the error message:

Code:
Run-time error '438'
Object doesn't support this property or method

but the error message doesn't appear when out of break mode

Stu
 
Upvote 0
I would suggest your code would be better specifying a range to filter, rather than assuming that the correct range is selected.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

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