VBA just stops when opening a macro workbook
I don't know if this has anything to do with why our VBA code is
failing.
But the code should look more like this (untested)
Dim book as Workbook
Dim sheet as Worksheet
* * Application.EnableEvents = False
* * Set book = Workbooks.Open Filename:= "C:\Test
\ExcelWB_Template.xls"
Set sheet = book.Sheets("Sheet 1")
sheet.Range("A1").FormulaR1C1 = "ABC Company"
sheet.Range("A2").FormulaR1C1 = "123"
As a general rule two things will make VBA hang:
1. A failed internet connection (you can have a connection to the
internet but some server might not be responding), or
2. Some spot in the code that is resource intensive - such as a huge
copy and paste instruction.
The template that you are opening might be doing something related to
items 1 and 2.
--
Thx
MSweetG222
|