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: 2,337
Default Stops executing or keep looping

I generally use the simple approach. See if this works.

Sub Main()
Workbooks.Open Filename:="myfile.xls"
Call Var1
Call Var2
Call Var3
End Sub


"Kenji" wrote in message
...
Some how, either stops in middle of codes or keep looping.
I don't know how to overcome this.
All these are in Module1.

The below is not an actual code, but structure is like so.

Here are my problems with VBA:

1. If "myfile.xls" contains some kind of macros, it stops program after
the file is opened. If I step through, it will go back to "Sub Main()"
because it never goes to the next instruction (Call Procedure(Var1)).
Stepping through will cause looping because it never goes to End Sub.

2. Similar to #1, but after executing "Call Procedure(Var1)", the program
will not go to the next instruction.. If I step through, at the end of

Call
Procedure(Var1), it goes back to Sub Main() again.

Both situations do not cause any errors.

If anyone can help me some possibilties or give me some tips on how to
prevent this, I would really appreciate it.

Thanks.



Sub Main()
Dim Var1 As Integer, Var2 As Integer, Var3 as Integer
Workbooks.Open Filename:="myfile.xls"
Call Procedure(Var1)
Call Procedure(Var2)
Call Procedure(Var3)
End Sub




 
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
Why are my functions not executing? Charlie Excel Worksheet Functions 1 March 3rd 09 11:21 PM
EXECUTING A FORMULA Theresa New Users to Excel 4 January 18th 07 06:09 PM
executing a macro within another brian Excel Discussion (Misc queries) 3 July 5th 06 01:22 AM
Executing Macros bmorganh Excel Discussion (Misc queries) 1 January 27th 06 12:03 AM
Forumlas Not Executing Trey Excel Discussion (Misc queries) 2 January 25th 06 04:02 PM


All times are GMT +1. The time now is 12:01 AM.

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"