Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Why won't this sheet delete?

Why doesn't the following code, which runs without any errors, result in the
sheet named being deleted?

Set wkbkRpt = XLobj.Workbooks.Open(strRptPath)
wkbkRpt.Activate
Set shtTmplt = wkbkRpt.Sheets("MarketRpt")
shtTmplt.Delete
wkbkRpt.Worksheets(1).Activate
wkbkRpt.Save

Thanks,

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200807/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default Why won't this sheet delete?

Check for spaces in the worksheet such as "MarketRpt ". Unnoticable but is
different from "MarketRpt".
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"ragtopcaddy via OfficeKB.com" wrote:

Why doesn't the following code, which runs without any errors, result in the
sheet named being deleted?

Set wkbkRpt = XLobj.Workbooks.Open(strRptPath)
wkbkRpt.Activate
Set shtTmplt = wkbkRpt.Sheets("MarketRpt")
shtTmplt.Delete
wkbkRpt.Worksheets(1).Activate
wkbkRpt.Save

Thanks,

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200807/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 342
Default Why won't this sheet delete?

Deleting a worksheet causes an alert message that could be foiling your
attempt. Consider:

Application.DisplayAlerts = False
ThisWorkbook.Worksheets("Sheet3").Delete
Application.DisplayAlerts = True

"ragtopcaddy via OfficeKB.com" wrote:

Why doesn't the following code, which runs without any errors, result in the
sheet named being deleted?

Set wkbkRpt = XLobj.Workbooks.Open(strRptPath)
wkbkRpt.Activate
Set shtTmplt = wkbkRpt.Sheets("MarketRpt")
shtTmplt.Delete
wkbkRpt.Worksheets(1).Activate
wkbkRpt.Save

Thanks,

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200807/1


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Why won't this sheet delete?

Thanks fellas!

TomPl wrote:
Deleting a worksheet causes an alert message that could be foiling your
attempt. Consider:

Application.DisplayAlerts = False
ThisWorkbook.Worksheets("Sheet3").Delete
Application.DisplayAlerts = True

Why doesn't the following code, which runs without any errors, result in the
sheet named being deleted?

[quoted text clipped - 7 lines]

Thanks,


--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200807/1

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
Delete ROW on Sheet#1 corupts data on Sheet#2 Duane Excel Worksheet Functions 4 February 11th 10 07:53 PM
Delete values in sheet 2 that arre found in sheet 1 np Excel Discussion (Misc queries) 1 December 10th 09 07:21 PM
Delete rows from one sheet containing deatils on the second sheet [email protected] New Users to Excel 4 September 6th 07 11:10 AM
delete content of one sheet off another sheet eureka Excel Programming 1 April 4th 06 06:47 AM
delete sheet Esau[_2_] Excel Programming 1 September 15th 04 07:10 PM


All times are GMT +1. The time now is 05:43 PM.

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

About Us

"It's about Microsoft Excel"