Hey Guys. So I've created some code, part of which is designed to name a custom range.
Code is:
Rather simple, generate the range name, and whatever worksheets we are on at the time, gets that named range. The code works great by itself, in the spreadsheet where the code was originally written.
HOWEVER, when I create a packed custom .xlam file, which I have added as an Add-in into excel, the code doesn't work. I execute the code step by step, get to the point where the code above executes, but it simply doesn't name the range.
Again, when running the code into the original spereadsheet where the code was written, it works, however when opening a new spreadsheet (with appropriate sheet names), the code executes, just doesn't do anything...
Thanks.
Code is:
Code:
ThisWorkbook.Names.Add Name:="Model2", _
RefersTo:=Worksheets("Sheet2").Range(range1)
Rather simple, generate the range name, and whatever worksheets we are on at the time, gets that named range. The code works great by itself, in the spreadsheet where the code was originally written.
HOWEVER, when I create a packed custom .xlam file, which I have added as an Add-in into excel, the code doesn't work. I execute the code step by step, get to the point where the code above executes, but it simply doesn't name the range.
Again, when running the code into the original spereadsheet where the code was written, it works, however when opening a new spreadsheet (with appropriate sheet names), the code executes, just doesn't do anything...
Thanks.