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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Code In Excel

Status
Not open for further replies.

philthepowerhouse

IS-IT--Management
Jun 30, 2005
24
GB
Hi there!

Please would anyone be able to tell me what I can do to close Excel itself and have a related Access database form open on the closure of Excel - as the Excel is a link from the form but I want to go back to the form after making alterations to the workbook.

Thank you in advance

Powerhouse!
 
?? I dont understand the problem very well.

You have a form in access, click button -> open excel (and spreadsheet?) -> do stuff? -> close excel -> back to form?

is this it? and where is your problem?

Robert Cumming
 
Thanks for your prompt reply!

Well your almost there - its quite a petty thing but annoying - form in access, click button -> open excel (and spreadsheet?) -> do stuff? -> when I close the excel the access form is minimised I was thinking of a macro to maximise it when excel closes????

Sorry if I'm masting your time

Many thanks

Powerhouse
 
Ok, well I dont use access so not sure if I can help, but have you tried to simply Show the form?
i.e.
Debug the code (step through), and try showing the form (userform.show) after the excel application closes?

Robert Cumming
 
Thank you I will try this, just to check are saying to type the code 'userform.show' after some code about Excel closing??

Sorry to be difficult!

Powerhouse

This is a great site though!
 
ok - bit more info needed here (btw you are not wasting anyone's time !)

When you "go to excel", how are you doing it ?? are you using VBA to open excel or doing it manually ?

You should be able to open Excel form Access VBA and then have an "Event" fire on the workbook close to take you back to Access - kinda depends on the specifics though...

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
I'll second that
xlbo said:
btw you are not wasting anyone's time !
I was assuming that your were starting excel by creating the excel application in vba from access, so that when you close excel it returns to access? (I assumed that the code would capture this?)

But as I said I dont use access so I'm guessing rather than testing/speaking of experience

Robert Cumming
 
Cheers Guys,

When I open Excel from my Access form, it is done through a Hyperlink - this allows me to edit the work book in Excel and what I want then is to somehow close and save Excel and be back at the Access form from where I started (Which always seems to minimised!!)

Many Thanks again

Powerhouse
 
Ok - you're gonna need VBA for this I would've thought although I don't really know why the form would be minimised.

Personally, before carrying on with this, I would be tempted to post a question in one of the Access fora, asking whether you can set a form to be maximised if you move away and then back to it - maybe even put a tiny of code in the form_lost_focus or form_got_focus events (or similar - not quite sure what they are called in access)

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top