Add a pop up form on export to excel (1 Viewer)

alsoascientist

Registered User.
Local time
Today, 01:56
Joined
Mar 26, 2012
Messages
39
Hi all,

I don't know if this is even possible but I thought I would put out some feelers!

I have a code that creates a query from my database and uses the record source to create a new workbook in excel with that data. I then have a code that takes control of excel and does the formatting for me, including some condidtional formatting.

What I would like to do is add a pop up form to the instance of excel when it is created that will sit on top of it with a button that will reformat the data using the same conditional formatting (the data will be sorted so if it is unsorted the formatting goes all off)

I think what I need is a code to create a code (?!) Is this even possible? I'm not looking for a complete answer (though would definitely appreciate one!) but I have been trudging through here and google and can't even see any questions about it, and am wondering if this can even be done?

Thoughts? Ideas?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:56
Joined
Feb 19, 2002
Messages
43,519
This is more Excel than most Access people know. You may have better luck with a code solution from an Excel person. The basic code will be the same, it is simply a matter of changing how objects are referenced because if you get an "Excel" VBA solution, it will be written from the perspective of Excel and you will need to change it to an "outside looking in" perspective. Of course, the code you find could be place in the Excel template and just run there.

And finally, consider creating a template and just using Access to populate a data table. Have all the code and formatting actually in the template.
 

alsoascientist

Registered User.
Local time
Today, 01:56
Joined
Mar 26, 2012
Messages
39
Thanks Pat,

You're quite right - it is more excel - I have been trying to play around with using a template to export to with the code already in there but didn't realise this isn't applicable for exporting to excel.

I have got around it by exporting the query to one doc, and opening a second at the same time (the second with the codes in) and using the excel control within access to copy and paste. Not really what I wanted but it does work.
 

Users who are viewing this thread

Top Bottom