tnewman
10-12-2010, 05:05 AM
I've been at this problem for a few days and still haven't been able to overcome this particular issue.
I designed my add-in to be able to export all named ranges in an active workbook, manipulate, and restore the ranges. My problem occurs when I have local named ranges referring to other workbooks. I can add the ranges only with the other workbook open. I'm trying to get this solved for a specific business application, and could use some help.
I've tried quite a few iterations of the following:
...
ActiveWorkbook.Names.Add Name:=.Cells(2 + I, 1).Value, _
RefersTo:=Workbooks(strPath & "[" & .Cells(2 + I, 3).Value & "]").Worksheets(.Cells(2 + I, 4).Value).Range(.Cells(2 + I, 5).Value)
...
where the cell references refer to the workbook name ("A Name.xlsx"), the worksheet name, and the "$A$1:$B$2" reference.
Any help would be appreciated.
I designed my add-in to be able to export all named ranges in an active workbook, manipulate, and restore the ranges. My problem occurs when I have local named ranges referring to other workbooks. I can add the ranges only with the other workbook open. I'm trying to get this solved for a specific business application, and could use some help.
I've tried quite a few iterations of the following:
...
ActiveWorkbook.Names.Add Name:=.Cells(2 + I, 1).Value, _
RefersTo:=Workbooks(strPath & "[" & .Cells(2 + I, 3).Value & "]").Worksheets(.Cells(2 + I, 4).Value).Range(.Cells(2 + I, 5).Value)
...
where the cell references refer to the workbook name ("A Name.xlsx"), the worksheet name, and the "$A$1:$B$2" reference.
Any help would be appreciated.