Create a Macro in Excel from Access

J

jj

Hi ng

I would like to create a checkbox in Excel which runs a Macro in Excel. I
would like to do this from Access VBA (automatic) - I know how to create the
checkbox - but I have no clue what so ever - how to create the Macro.

I wondered if I can export a module with the procedure (macro) from access
to excel (automation)?, or I can create a new module in excel from access
vba, and create the macro from it?

TIA
JJ
 
G

Guest

Hi

It may be a silly question (sorry if it is) but why not just create the
macro in excel and then shell call it from access vba. Seems to be the easy
thing to do.
 
A

AnandaSim

VBA interop between Excel, Access, Word is well understood and well
documented. There are books and web references on this.

1. Decide which will be the host to store the VBA programming.

2. Learn and understand the object model (objects, methods,
properties) of what you are trying to program -
Access
http://msdn2.microsoft.com/en-us/library/bb266848.aspx
Excel
http://msdn2.microsoft.com/en-us/library/bb332345.aspx
DAO
http://msdn2.microsoft.com/en-us/library/bb244903.aspx
Excel allows you a leg up because it can record a VBA macro.

3. Set the relevant object reference and program away.

HTH
Ananda
 
J

jj

Hi Wayne

I need to autogenerate the macro from access VBA - in Excel, so that the
Excel file can be distributed without access. This is a weekly task with
different kind of data information, which must run all by it self.

Regards
JJ
 
J

jj

Hi Ananda

Thank you for your answer.
I forgot to write that it is Access and Excel 2000 and unfortunately I'm
not really sure I understand what you write below?

Regards
JJ
 
A

AnandaSim

Hi Ananda

Thank you for your answer.
I forgot to write that it is Access and Excel 2000 and unfortunately I'm
not really sure I understand what you write below?

Regards
JJ

Ok, let's start again - it is hard to grasp what you are trying to do.

1. You have an Access database
2. You want to produce an Excel file using data from the Access
database
3. You want to add to the Excel file, a VBA module so that someone
using only the Excel file, can click on something in Excel and run the
Excel macro.

Is that right? If it is then....

1. This is about programming and manipulating Excel. You'll tap in on
a lot of Excel expertise at the microsoft.public.excel newsgroups.

2. I would bypass some of this difficulty by separating code from
data. I would have an Excel file containing vba programming that does
not need to be changed weekly. I would have another Excel file that is
only data.

HTH
Ananda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top