Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copied code from excell macro problems

Status
Not open for further replies.

kobooky

Technical User
May 29, 2005
20
IL
When manuvering data from access to excell,in many threads the suggestion is to:
open excell
record a macro
edit the macro in excell
copy the code to VBA module.

To my opinion, this is a simple but genius recommendation.
The probleme is that most of the time the syntax does not work strait away.
It needs some modification or it will prompt you with many errors.
The question is:
Are there any guide lines for those needed modifications in the code or this is just a trial and error process?

Many thanks in advance.
 



Hi,

You need to understand the concept of an application object model. Access has an object model and Excel has an object model. They are different.

So when you bring code that works in one application to another, it must be modified to work in that very different environment.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Are there any guide lines
Always use full qualified objects, eg, instead of:
ActiveCell.Value = "something"
use:
yourExcelAppObject.ActiveCell.Value = "something"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you all!!

But, sorry - what is PHV?

 
But, sorry - what is PHV?
PHV is simply, eh, me ...
 
Sorry again. I didn't pay attention.
I hope you weren't offended.
but I do not understand:
"DITTO to PHV" from SkipVought.
 
My understanding is that Skip agrees with me ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top