LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Timing Issue??

Hi
I am trying to adapt Chip Pearson's code and insert the same procedure into
2 added worksheets.

Strange thing is my code only fails each time I start a new instance of the
workbook. Even then, when the code breaks on error with 'Subscript out of
Range' and I click to continue in Debug mode the code completes without error
AND the new module is installed correctly in both new worksheets.

Within the same instance of the workbook and beyond the initial 'block' the
procedure works without hesitation repeatedly. When creating the second of
the 2 worksheets, the code never fails whether it is in the first instance of
the workbook or not.

The fact that the identical code works on the second worksheet insert and
works repeatedly thereafter (within the same wb instance) suggests a compile
timing problem but how do I get around it?
The code fails at *** with Subscript out of Range...

Sheets.Add After:=Sheets(Sheets.Count)
Set ws = Sheets(Sheets.Count)
With ThisWorkbook.VBProject.VBComponents(ws.CodeName).C odeModule '***
.InsertLines .CountOfLines + 1, _
'required proc'
End With

What am I missing? I would appreciate any help.

T.I.A.

Geoff

 
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
Advancing Timing lsmft Excel Discussion (Misc queries) 2 April 9th 06 04:04 PM
Timing Chart sveasie Charts and Charting in Excel 1 February 18th 05 02:01 AM
VB Timing Question Pakenn Excel Programming 2 June 15th 04 08:24 AM
Timing Problem can someone help please RPIJG[_42_] Excel Programming 3 June 14th 04 05:26 PM
Program timing Christof DB Excel Programming 3 October 24th 03 04:56 PM


All times are GMT +1. The time now is 01:12 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"