Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using ActiveWorkBook.Container

Hi,
I am trying to write a macro in excel. I am trying to use the
container method.

Dim x As Object
Dim xx
xx = UCase(ActiveWorkbook.Name) 'This works
Worksheets("Sheet1").Activate
Set x = ActiveWorkbook.Container 'Get error at this line

The error is:
Run time error 1004. Application-defined or object-defined error

Does any one know why this would happen?

Regards,
AA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Using ActiveWorkBook.Container

Hi Pukya,

Your objectives are unclear - please explain.

However, from VBA help on the Container method:

'-----------------------
Use this property with a contained workbook to return the container object.
If the container doesn't support OLE Automation or the workbook isn't
embedded, this property fails.
'-----------------------


---
Regards,
Norman


wrote in message
ups.com...
Hi,
I am trying to write a macro in excel. I am trying to use the
container method.

Dim x As Object
Dim xx
xx = UCase(ActiveWorkbook.Name) 'This works
Worksheets("Sheet1").Activate
Set x = ActiveWorkbook.Container 'Get error at this line

The error is:
Run time error 1004. Application-defined or object-defined error

Does any one know why this would happen?

Regards,
AA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Using ActiveWorkBook.Container

See response in excel.misc.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ups.com...
Hi,
I am trying to write a macro in excel. I am trying to use the
container method.

Dim x As Object
Dim xx
xx = UCase(ActiveWorkbook.Name) 'This works
Worksheets("Sheet1").Activate
Set x = ActiveWorkbook.Container 'Get error at this line

The error is:
Run time error 1004. Application-defined or object-defined error

Does any one know why this would happen?

Regards,
AA



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
Can't get ActiveWorkbook.Container to work Ken Valenti Excel Programming 3 March 17th 05 04:05 PM
Workbook container - can't get it to work Ken Valenti Excel Programming 0 March 14th 05 07:59 PM
Container property Stewart Walker Excel Programming 0 May 28th 04 10:28 AM
OLE Container Control in VB.NET Yi[_2_] Excel Programming 5 October 14th 03 02:41 AM
Iterate over Collection Objects in Container. Bob Kilmer Excel Programming 1 August 28th 03 02:37 AM


All times are GMT +1. The time now is 06:40 AM.

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

About Us

"It's about Microsoft Excel"