View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default copying from another instance of excel

Thanks Ray,

Tried that but with no joy. also tried (1) in place of
("sheet1")

here is the result of f1

Application Property
See AlsoApplies ToExampleSpecificsWhen used without an
object qualifier, this property returns an Application
object that represents the Microsoft Excel application.
When used with an object qualifier, this property returns
an Application object that represents the creator of the
specified object (you can use this property with an OLE
Automation object to return the application of that
object). Read-only.

expression.Application
expression Required. An expression that returns one of
the above objects.

Example
This example displays a message about the application that
created myObject.

Set myObject = ActiveWorkbook
If myObject.Application.Value = "Microsoft Excel" Then
MsgBox "This is an Excel Application object."
Else
MsgBox "This is not an Excel Application object."
End If


-----Original Message-----
Do you get an error? What does it say?

My guess is that your problem is with (Sheet1). When

using
Workbook.Worksheets, the argument expected is either the

numeric
index of the worksheet or the name property of the sheet -

which is a
string. So, try using ("Sheet1") instead (Sheet1).

Ray at work


"Paul" wrote in

message
...
Is it possible to copy cell contents between instances

of
excel??

I cannot get the following code to work. Can anyone

tell
me why?

Application.Workbooks("book2.xls").Worksheets

(Sheet1).Range
("a1").Value = Application.Workbooks
("book1.xls").Worksheets(Sheet1).Range("a1").Va lue



.