Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code execution has been interrupted


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

--
Stuart
-----------------------------------------------------------------------
Stuart C's Profile: http://www.excelforum.com/member.php...fo&userid=3270
View this thread: http://www.excelforum.com/showthread.php?threadid=52532

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Code execution has been interrupted

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

"Stuart C" wrote:


Hi,

Do you know why I'd be receiving this error when running an excel
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.


--
Stuart C
------------------------------------------------------------------------
Stuart C's Profile: http://www.excelforum.com/member.php...o&userid=32706
View this thread: http://www.excelforum.com/showthread...hreadid=525323


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code execution has been interrupted


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

--
Stuart
-----------------------------------------------------------------------
Stuart C's Profile: http://www.excelforum.com/member.php...fo&userid=3270
View this thread: http://www.excelforum.com/showthread.php?threadid=52532

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Code execution has been interrupted

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

"Stuart C" wrote:


Thanks for the reply Phil,

I've simplified the code for now (as below), and am still getting the
same error when it gets to End Sub. But the work-book does open. And
there doesn't appear to be any comment after "Value" and before "End
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 way
to properly learn VB?

Cheers,
Stuart.


--
Stuart C
------------------------------------------------------------------------
Stuart C's Profile: http://www.excelforum.com/member.php...o&userid=32706
View this thread: http://www.excelforum.com/showthread...hreadid=525323


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
code execution has been interrupted Who I Am Excel Programming 1 February 2nd 06 11:54 AM
Code execution has been interrupted Craig Excel Programming 1 January 25th 06 07:19 AM
Code Execution has been Interrupted JPutman Excel Programming 4 August 24th 04 02:17 PM
Code Execution Has been Interrupted Adrian[_7_] Excel Programming 0 July 30th 04 10:02 AM


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