Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Only CreateObject Syntax works.

Hai,

I am facing a problem while working with Excel object in VB.

I have added a reference to Excel 10.0 object library, but i am unable to
create a Excel.Application object. (I have Office XP installed in my system.)

like

Dim objExcel as New Excel.Application
( here the intellisense is not showing Excel)

but i am able to do usign Createobject syntax.

What could be the problem..

Thanks.
V.Boomessh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Only CreateObject Syntax works.

Could be other reference that caused the problem.

I managed to do that like

Option Explicit
Dim mexcel As Excel.Application

Public Sub openexcel(ByVal s As String, ByRef item As MailItem)
Dim fso As New FileSystemObject
Dim rec As Recordset
Set mexcel = New Excel.Application
End Sub

--
Lucotus


"Boomessh" wrote:

Hai,

I am facing a problem while working with Excel object in VB.

I have added a reference to Excel 10.0 object library, but i am unable to
create a Excel.Application object. (I have Office XP installed in my system.)

like

Dim objExcel as New Excel.Application
( here the intellisense is not showing Excel)

but i am able to do usign Createobject syntax.

What could be the problem..

Thanks.
V.Boomessh

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Only CreateObject Syntax works.

Hai ,

THanks for your reply,

but when i write
Dim objExcel as Excel ( and on keeping "." the intellisense gives me only
Adjustments Class and NOt Application.

I have even reinstalled the OFFICE, but no use.

Guide me, thanks,

V.Boomessh



"lucotuslim" wrote:

Could be other reference that caused the problem.

I managed to do that like

Option Explicit
Dim mexcel As Excel.Application

Public Sub openexcel(ByVal s As String, ByRef item As MailItem)
Dim fso As New FileSystemObject
Dim rec As Recordset
Set mexcel = New Excel.Application
End Sub

--
Lucotus


"Boomessh" wrote:

Hai,

I am facing a problem while working with Excel object in VB.

I have added a reference to Excel 10.0 object library, but i am unable to
create a Excel.Application object. (I have Office XP installed in my system.)

like

Dim objExcel as New Excel.Application
( here the intellisense is not showing Excel)

but i am able to do usign Createobject syntax.

What could be the problem..

Thanks.
V.Boomessh

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Only CreateObject Syntax works.

I don't use VB, but how about trying:

dim objExcel as Excel.Application
set objexcel = new excel.application

This kind of thing works ok for me in MSWord (with that reference set).

Actually, both these worked ok (from MSWord):

Option Explicit
Sub testme()
Dim objExcel As Excel.Application
Set objExcel = New Excel.Application
objExcel.Visible = True
objExcel.Workbooks.Add
End Sub

Sub testme2()
Dim objExcel As New Excel.Application
objExcel.Visible = True
objExcel.Workbooks.Add
End Sub

Any chance that excel is just closing before you want it to close. I had to do
something in excel (workbooks.add was enough) to keep it open after both of the
routines ran.

Boomessh wrote:

Hai,

I am facing a problem while working with Excel object in VB.

I have added a reference to Excel 10.0 object library, but i am unable to
create a Excel.Application object. (I have Office XP installed in my system.)

like

Dim objExcel as New Excel.Application
( here the intellisense is not showing Excel)

but i am able to do usign Createobject syntax.

What could be the problem..

Thanks.
V.Boomessh


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To CreateObject In VB To AutoCad KinCheong Low via OfficeKB.com Excel Programming 0 January 20th 05 03:43 AM
Createobject (repost) keepITcool Excel Programming 0 July 14th 04 03:09 PM
CREATEOBJECT Using VB Karthik[_2_] Excel Programming 2 June 16th 04 09:08 PM
Difference between NEW and CREATEOBJECT? Mark[_36_] Excel Programming 3 February 19th 04 02:26 PM
Templates and CreateObject John Excel Programming 1 October 29th 03 01:07 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"