Hi guys got a real problem that has stopped me in my track.

Basically I am calling a Excel spreadsheet from VB and running a VBA routine within the excel program. It seems to go through the routine (Because I stuck a message box at the end of it, whcih flashes up correctly). without incident. But then the excel program freezes!!! I have to right click and close. Can anybody offer any idea how I can stop this. If I run the spreadsheet + macro independent of VB it runs fully without locking. Here is the VB code:




Dim xlproj As Excel.Application

Dim strPath As String

strPath = "c:\data\xlfiles\SOtabs.xls"
Set xlproj = Excel.Application

xlproj.Workbooks.Open "c:\data\xlfiles\Hospital Control Charts\overdispersed.xls"
xlproj.Visible = True

xlproj.Application.Run "getdata", strPath

Control Charts\overdispersed.xls"")

Set xlproj = Nothing

Thank you

Gerard