Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Code execution has been interrupted

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stuart C - 22 Mar 2006 17:15 GMT
Hi,

Do you know why I'd be receiving this error when running an exce
macro?  It occurs at End sub.

This is my code:

Sub OpenInpSpread()

Dim varFileName As String
varFileName = Sheets("DataInput").Range("B3").Value

Workbooks.Open Sheets("DataInput").Range("B3").Value

'Cells.Find(What:="Product", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext
_
MatchCase:=False, SearchFormat:=False).Activate

End Sub

Thankyou,
Stuart
Philip - 22 Mar 2006 18:06 GMT
Hi,

is this code commented:

'Cells.Find(What:="Product", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False, SearchFormat:=False).Activate

Normally you get that message from the VB Compiler when it comes to a Stop
statement in the code.

so look for that somewhere in your VB Project ...

HTH

Philip

> Hi,
>
[quoted text clipped - 19 lines]
> Thankyou,
> Stuart.
Stuart C - 22 Mar 2006 18:24 GMT
Thanks for the reply Phil,

I've simplified the code for now (as below), and am still getting th
same error when it gets to End Sub.  But the work-book does open.  An
there doesn't appear to be any comment after "Value" and before "En
Sub".

Sub OpenInpSpread()

Workbooks.Open Sheets("DataInput").Range("B3").Value

End Sub

Do you know what it might be?  And do you have a tip for the best wa
to properly learn VB?

Cheers,
Stuart
Philip - 23 Mar 2006 10:02 GMT
Is this a good workbook name and path?

Sheets("DataInput").Range("B3").Value

copy the text in the cell, and using CTRL-O in Excel, try to open it by
pasting that in the Filename box of the Open dialog.

HTH

Philip

> Thanks for the reply Phil,
>
[quoted text clipped - 14 lines]
> Cheers,
> Stuart.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.