How do I update a cell in a closed workbook?

Hey,

How do I, with VBA code, update a cell in a closed workbook when a cell in the active workbook changes?

When the update is done, the cell value in the closed workbook shall have the same value as the changed cell in the active workbook.

Best Regards

Cathrine

[1230 byte] By [MyLady] at [2008-1-8]
# 1

No answers, then I guess it can’t be done with VBA code… or can it, anybody?

Cath

MyLady at 2007-10-2 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 2
Hi,

This article maybe useful.
http://www.excelkb.com/article.aspx?id=10155&query=update+closed+workbook

If you are using code what is the reason for not opening, updating and then closing the workbook via code?

AndyPope at 2007-10-2 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 3

Hey Andy,

Thanks for your reply!!!

I have played around with the code in the article you pointed to, but it gives me the compile error “User-defined type not defined”. What to do… any ideas/ solution?

Cath

MyLady at 2007-10-2 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 4
Did you include the reference to the library as stated at the top of the page?

External reference(s):

  • Microsoft ActiveX Data Object 2.5 Library and later.

Use menu Tools > References..
AndyPope at 2007-10-2 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 5

Hey again Andy,

Great thanks for the reminder!

I forgot that… it works fine.

And to your question, for the curiosity reason, if it could be done, I wanted to try out this method instead of opening the workbook. It could be useful one day…

Cath

MyLady at 2007-10-2 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...