Can I write MS Excel Code inside MS Access module ? (1 Viewer)

HelpMoses76

Member
Local time
Yesterday, 23:19
Joined
Sep 17, 2020
Messages
45
Hi

Can I actually write MS Excel Code inside an MS Access module and have the operations done on an Excel File specified in MS Access code?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 04:19
Joined
Jul 9, 2003
Messages
16,282
Can I actually write MS Excel Code inside an MS Access module and have the operations done on an Excel File specified in MS Access code?

Yes..
See YouTube:-

Table to Many Excel Sheets - Nifty Access​


AND:-

Access Table to Many Excel Sheets

Excel Sheets From Access Table

Show/Hide & Export to Excel

Update Excel from MS Access

I use BTAB Development Code Here:-
Export A Table Or Query To Excel – Specific Worksheet on Specific Workbook

 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:19
Joined
Feb 28, 2001
Messages
27,185
It is called an Excel Application Object.

If you open this, you have "real" Excel open on a real Excel-related file like .XLSX or .XLS or some similar file type. If you have the correct references for your VBA, you are able to manipulate Excel objects from an Access application. Uncle Gizmo has some great videos on the subject. For supplemental reading, look up the name I gave you in the first line of this post.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 23:19
Joined
May 21, 2018
Messages
8,529
an I actually write MS Excel Code inside an MS Access module and have the operations done on an Excel File specified in MS Access code?
I fact you can write vba code in Acess to control all Office products (Outlook, Excel, Power Point, etc.)
Or vice versa.
 

Isaac

Lifelong Learner
Local time
Yesterday, 20:19
Joined
Mar 14, 2017
Messages
8,777
Take # five..

Or you can use VB script and not even use any office app to host a code that will be very similar to vba.

Yee-Haw!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 04:19
Joined
Jul 9, 2003
Messages
16,282
This is an excellent article by Doug Steele:- Excelling Automatically The article has a good explanation of early and late binding and why you should use either one and when...
 

Isaac

Lifelong Learner
Local time
Yesterday, 20:19
Joined
Mar 14, 2017
Messages
8,777
Good reminder, thanks UG.
Just today actually I passed my boss a tiny MS Access tool for administrative use. I had spoiled myself with Excel early binding (which I don't often do, and not sure really why I had done it this time). I have 365 and he has 2010. The references did not backwards adjust and caused the usual problem. I switched to late binding and all was well. I'm rusty in Access..that's my excuse for my silly forgetfulness.
 

Users who are viewing this thread

Top Bottom