View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jstrater jstrater is offline
external usenet poster
 
Posts: 13
Default #NAME when I insert a sheet from a template

I'm inserting a worksheet, and that worksheet is from a template file. So the code looks like

Set wks = ThisWorkbook.Worksheets.Add(NextSheet, , , "C:\MyTemplate.xlt"

This works well except for one thing: formulas in this new sheet that refer to named ranges give a #NAME error. If I click my mouse in the formula editor and press <Enter, magically the formula resolves properly. I've tried using Worksheet.Calculate and Application.Calculate, but they don't make any difference. Is there a way I can force these formulas to calcualate from code

I doesn't matter if the range is defined locally to the sheet or globally to the workbook

Thanks

James