Jan,
- Agreed.
- Yep, makes sense.
- If I look at the Source workbook I generally only have 1 ref and it points to the correct place, although the Scope = Workbook. Using edit the scope is greyed out, can you only set the scope on creation?
Re your suggestion on copying multiple sheets I have two problems:
- I need to be able to choose which sheets get copied (I create 6 or 7 files and they each have different combinations. So what I did was pass variables to a sub routine:
Sheets(Array(ExportSheetName1, ExportSheetName2, ExportSheetName3, ExportSheetName4, ExportSheetName5, ExportSheetName6, ExportSheetName7, ExportSheetName8, ExportSheetName9, ExportSheetName10, ExportSheetName11, ExportSheetName12, ExportSheetName13, ExportSheetName14, ExportSheetName15, ExportSheetName16)).Select
Sheets(Array(ExportSheetName1, ExportSheetName2, ExportSheetName3, ExportSheetName4, ExportSheetName5, ExportSheetName6, ExportSheetName7, ExportSheetName8, ExportSheetName9, ExportSheetName10, ExportSheetName11, ExportSheetName12, ExportSheetName13, ExportSheetName14, ExportSheetName15, ExportSheetName16)).Copy
- The other issue is I have one file that needs about 25 sheets and the Array seems to have a limit on how many sheets it can copy.
Strange thing is this has been working in 2003 for years.
I have also posted on another forum:
http://smurfonspreadsheets.wordpress.com/2009/02/24/excel-2007-lost-names/#comment-15117
Patrick suggested I round trip my workbook through HTML and while I am new to this concept and it cost me a lot of work today, it did highlight that Excel 2007 was not happy with a number of Named Ranged and the good thing was the ones 2007 kept (about 60%) had the correct Scope for the sheet. Problem is round tripping completely guts my workbook to the point I would have to start again. So the question is how can I find and fix all the suspect Named Ranges without round tripping?
Is it possible for example to write some VBA that will export all the named ranges to a file and I can reapply to my non round tripped file?