Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

Member 'Range' implicitly references 'ActiveSheet': should be "Application"

Open SystemsModelling opened this issue 2 years ago • 0 comments

Rubberduck version information

Version 2.5.2.5906 OS: Microsoft Windows NT 10.0.19042.0, x64 Host Product: Microsoft Office x86 Host Version: 16.0.15028.20160 Host Executable: EXCEL.EXE

Description A Code Inspection Warning is Member 'Range' implicitly references 'ActiveSheet It should be Application because the argument may include a reference to a different sheet.

To Reproduce

sAddress="Sheet1!A1:B4"
? range(saddress).Count
 8 
? activesheet.name
Sheet2
? activesheet.range(saddress).Count
Error 1004

SystemsModelling avatar Apr 08 '22 14:04 SystemsModelling