View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default 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