ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   strange behaviour (https://www.excelbanter.com/excel-programming/276038-strange-behaviour.html)

patrick molloy

strange behaviour
 
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 !







-----Original Message-----
hi

all

I have created one activeX control. when I called this
control with object tag in a browser, I found strange
behaviour for the following code.

dim xlApp as excel.Application

set xlApp = createObject("Excel.Application")

xlApp.Workbooks.Add "C:\abc.xls" :::--- at this line
there is no problem when I use this control in VB

Projects.
but when i use the same control in IE, at this

perticular
line excel application screen becomes visible.
I have to write the code Xlapp.visible = false to hide

the
screen.
Please explain why this strange behaviour is happening.

regards
amod

.



All times are GMT +1. The time now is 09:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com