Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Use VBA to collect information from Excel cells to av word documen

I have reference Office 11.0 Object lib. as a default. To get all the Excel
objects i activate the Microsoft Excel 11.0 Object library.

Then i can brows it all, by then i create a VBA code then VBA can't use the
Excel Objects as :
Dim Text as string
Text=cstr(Workbooks("BookName.xls").Worksheets("Sh eetName").Cells(1,1))

I have tried a line i use in VB6

Dim XLS
Dim Text as string
set XLS = GetObject(, "Excel.Application")

XLS.Workbooks("BookName.xls").Worksheets("SheetNam e").Cells(1,1))

This gives med tha same as
Text =cstr(Exel.Workbooks("BookName.xls").Worksheets("S heetName").Cells(1,1))

I can brows the object model, but i can't use it.

Is there an other code that enebles the Excel object model in WORD.

Best regards





--
Øyvind
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use VBA to collect information from Excel cells to av word documen

GetObject and CreateObject are the ways to go.

IF it works in VB6, it should work in VBA

I assume you have opened BookName.xls and it has a sheet named SheetName

You may want to look at the Automation Help file

http://support.microsoft.com/default...b;en-us;260410
Microsoft Office 2000 automation Help file is available in the Download
Center

--
Regards,
Tom Ogilvy

"Øyvind" wrote in message
...
I have reference Office 11.0 Object lib. as a default. To get all the

Excel
objects i activate the Microsoft Excel 11.0 Object library.

Then i can brows it all, by then i create a VBA code then VBA can't use

the
Excel Objects as :
Dim Text as string
Text=cstr(Workbooks("BookName.xls").Worksheets("Sh eetName").Cells(1,1))

I have tried a line i use in VB6

Dim XLS
Dim Text as string
set XLS = GetObject(, "Excel.Application")

XLS.Workbooks("BookName.xls").Worksheets("SheetNam e").Cells(1,1))

This gives med tha same as
Text

=cstr(Exel.Workbooks("BookName.xls").Worksheets("S heetName").Cells(1,1))

I can brows the object model, but i can't use it.

Is there an other code that enebles the Excel object model in WORD.

Best regards





--
Øyvind



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Use VBA to collect information from Excel cells to av word doc

I had activated the workbook with current sheet. I read the automation help
file.
Thank you Tom.
--
Øyvind


"Tom Ogilvy" wrote:

GetObject and CreateObject are the ways to go.

IF it works in VB6, it should work in VBA

I assume you have opened BookName.xls and it has a sheet named SheetName

You may want to look at the Automation Help file

http://support.microsoft.com/default...b;en-us;260410
Microsoft Office 2000 automation Help file is available in the Download
Center

--
Regards,
Tom Ogilvy

"Øyvind" wrote in message
...
I have reference Office 11.0 Object lib. as a default. To get all the

Excel
objects i activate the Microsoft Excel 11.0 Object library.

Then i can brows it all, by then i create a VBA code then VBA can't use

the
Excel Objects as :
Dim Text as string
Text=cstr(Workbooks("BookName.xls").Worksheets("Sh eetName").Cells(1,1))

I have tried a line i use in VB6

Dim XLS
Dim Text as string
set XLS = GetObject(, "Excel.Application")

XLS.Workbooks("BookName.xls").Worksheets("SheetNam e").Cells(1,1))

This gives med tha same as
Text

=cstr(Exel.Workbooks("BookName.xls").Worksheets("S heetName").Cells(1,1))

I can brows the object model, but i can't use it.

Is there an other code that enebles the Excel object model in WORD.

Best regards





--
Øyvind




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 setup formula to collect ongoing information Darlene New Users to Excel 2 November 17th 08 08:31 PM
How can I collect specific data from cells in a fill-in form? Sherri at Quality Envelope Excel Discussion (Misc queries) 1 August 13th 08 03:06 PM
Is it possible to do spellcheck in partially-locked excel documen. kchambers Excel Discussion (Misc queries) 2 March 4th 05 05:07 PM
VBA Problem - How to collect and display text information from applicable cells. LegaLega Excel Programming 0 June 8th 04 07:17 PM
how to read multiple workbooks, collect a few cells from each? ms Excel Programming 1 November 16th 03 01:45 AM


All times are GMT +1. The time now is 09:28 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"