Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? WimR Excel Programming 9 July 25th 05 12:44 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM
Open a password protected excel workbook from second workbook to fetch data using dynamic connection kaustav choudhury Excel Programming 2 April 3rd 04 06:18 AM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Excel Programming 1 July 24th 03 11:37 PM


All times are GMT +1. The time now is 09:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"