Thread: Excel crashes
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
fred fred is offline
external usenet poster
 
Posts: 73
Default Excel crashes

Hi,

I am using Excel 2007 on Windows XP.

On the sheet I have a button (form button) that executes the macro below.
The macro runs fine, the new workbook (myTemplate1.xls) opens up OK.
The problem occurs when I close the workbook (myTemplate1.xls) Excel
crashes.
What am I doing wrong?

By the way I have been using myTemplate (opening it manually) for years
without a problem. It is only when I open it using the macro below that I
have this problem.

Thanks for any help
Fred


Sub Button432_Click()
Dim PartNo As String

PartNo = Trim(Sheet1.Range("C8").Value)
If PartNo < "" Then
Workbooks.Add Template:="\\myServer\myDrive\myTemplate.xlt"
End If
End Sub