Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
With, End with - workbook
Excel Experts,
How do I specify a workbook name in an End ..End With statement? The workbook is closed, and I want to add a new sheet to it. My code, which isn't working, is: With Workbooks("C:\ACDocs\Processes\Trading\MNCEntry.xl s") Sheets.Add After:=Worksheets("VLTrades") Worksheets(Worksheets.Count).Name = "VLTotals" End With I get a "subscript out of range" message. What is my error? Thanks in advance. Alan -- achidsey |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
With, End with - workbook
You have to open the workbook to add a sheet to it... I am affraid there is
no way around this one (to the best of my knowledge)... -- HTH... Jim Thomlinson "achidsey" wrote: Excel Experts, How do I specify a workbook name in an End ..End With statement? The workbook is closed, and I want to add a new sheet to it. My code, which isn't working, is: With Workbooks("C:\ACDocs\Processes\Trading\MNCEntry.xl s") Sheets.Add After:=Worksheets("VLTrades") Worksheets(Worksheets.Count).Name = "VLTotals" End With I get a "subscript out of range" message. What is my error? Thanks in advance. Alan -- achidsey |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming | |||
Open a password protected excel workbook from second workbook to fetch data using dynamic connection | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |