[AccessD] Deleting Worksheet

Charlotte Foust charlotte.foust at gmail.com
Thu Jan 30 20:47:22 CST 2014


So what is the original name of the sheet you're adding?  What is its name
in its parent template? And is the value of your Me.lstJobs.ItemData(intI)
expression a string that you can evaluate and test for?    I have workbooks
with no "Sheet1" in them, so it isn't requiring that name that's the
problem.  When you copy a worksheet it usually retains the name of the
sheet that's being copied (unless it would be a duplicate, of course).
 Maybe you need to count the number of worksheets in the workbook to be
sure you're tackling the right problem.

Charlotte



On Thu, Jan 30, 2014 at 6:12 PM, Rocky Smolin <rockysmolin at bchacc.com>wrote:

> Darryl:
>
> I'm not adding the new sheets - I'm copying from a template in another
> workbook:
>
>                 objXLWSAlcoa.Copy After:=objXLBook.Sheets(intXLSheetCount)
>                 objXLApp.ActiveSheet.Name = Me.lstJobs.ItemData(intI)
>                 objXLApp.ActiveWorkbook.Save
>                 Set objXLWS = objXLApp.ActiveSheet
>
> And that's working well.  The delete routine at the end cycles through all
> the sheets and deletes any that start with "Sheet".
>
> I had three brute force deletes call out Sheet1, Sheet2, Sheet3.  It
> deleted
> 2 and 3 and left 1.  So I tried cycling through the sheets looking for
> left("Sheet",5). No go.  I've tried a bunch of different things.  Nothing
> seems to work.
>
> I'm leaving town tomorrow so I may take this up again when I get back on
> Monday if I can't find a solution while I'm on the road.
>
> Thanks
>
> Rocky
>
>
>


More information about the AccessD mailing list