My Assistant
![]() ![]() |
|
|
Aug 5 2004, 09:01 AM
Post
#1
|
|
|
UtterAccess Addict Posts: 176 |
Heya-
I am using data from a second excel file in my main file. Is there a way I can open an excel file minimized in the background when the first one opens? And if so, can I then close it when the main one closes? Thanks Enigma |
|
|
|
Aug 5 2004, 09:20 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 13,031 From: Leicester, UK |
open the excel file, fress Alt + F11 to get into the VBA editor.
In the project pane double click on "this workbook" Then change the first drop down menu from general to workbook and make sure the second one says open add the following code CODE Workbooks.Open Filename:="C:\filename.xls" add the folowing code to the before close event for the workbook CODE Application.ScreenUpdating = False Windows("filename").Activate ActiveWindow.Close Application.ScreenUpdating = True The close routine is probably the long way round but it works |
|
|
|
Aug 5 2004, 09:45 AM
Post
#3
|
|
|
UtterAccess Addict Posts: 176 |
Great thanks!
|
|
|
|
Aug 5 2004, 09:47 AM
Post
#4
|
|
|
UtterAccess Addict Posts: 176 |
Hmmm. I seem to just be able to pull up "Worksheet" and "General". Worksheet doesn't have an "Open" event and I can't seem to access the workbook.
ANy thoughts? |
|
|
|
Aug 5 2004, 09:51 AM
Post
#5
|
|
|
UtterAccess Addict Posts: 176 |
I'm an idiot. Found it in the Project Explorer as you had directed me (IMG:http://www.utteraccess.com/forum/style_emoticons/default/tongue.gif) Thanks Again!
|
|
|
|
Aug 5 2004, 09:57 AM
Post
#6
|
|
|
UtterAccess Addict Posts: 176 |
Okay... Yes, I need to lay off the coffee... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/tongue.gif) I put the Workbooks.Open code in the open event of the workbook, but nothing appears to be running in terms of VBA. :( I tried just throwing a Msgbox "Hi" in with no results as well.
I have done quite a bit with Access, but I just started working with Excel. Do I have to enable the VB somehow? Again, I appreciate everything! Enigma |
|
|
|
Aug 5 2004, 04:14 PM
Post
#7
|
|
|
UtterAccess VIP Posts: 2,601 From: Dallas, Texas USA |
Go to tools/Macro/Security and set it to medium. If it is set to High the code will not run. If it is set to Low then anything will run.
HTH, Eric |
|
|
|
Aug 6 2004, 03:35 AM
Post
#8
|
|
|
UtterAccess VIP Posts: 13,031 From: Leicester, UK |
did what "Jay & Silent Bob" Suggest work? (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)
if not let me know |
|
|
|
Aug 9 2004, 01:31 PM
Post
#9
|
|
|
UtterAccess Addict Posts: 176 |
Sorry for the delay in response.
It worked like a charm. Thank you both! (IMG:http://www.utteraccess.com/forum/style_emoticons/default/tongue.gif) |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th May 2013 - 09:29 AM |