View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pukya78@gmail.com is offline
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