strange behaviour

P

Patrick Molloy

First, change your code to
EITHER

dim xlApp as Object
set xlApp = CreateObject("Excel.Application")

OR

dim xlApp as Excel.Application
set xlApp = New Excel.Application


In general, the first is safer for web apps in my
experience. For VB apps, use the latter as it is more
efficient plus it givs the developer intellisense

Also, fix the following line

xlApp.Workbooks.Add "C:\abc.xls"

to

xlApp.Workbooks.Open "C:\abc.xls"


remember the syntax !
 
Top