Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Close form automatically upon opening workbook

Hi,

I have a form that is being displayed automatically upon opening the
workbook (I have added the following code in the workbook open event:

Private Sub Workbook_Open()
FrmMain.Show
End Sub

However, I have another workbook that imports information from this
(and many copies of this) workbook). It automatically opens the
workbook, however it halts on the userform that is being displayed. Is
there a possibility that the form is closed with VBA code?

Currently I have:

Path = ActiveWorkbook.Path & "\IMPORT\"
ChDir Path
f = Dir(Path & "*.xls")
While f < ""

Workbooks.Open f, , , , "PASSWORD"
Unload FrmMain
Sheets("Overview").Activate

The code stops on Unload FrmMain. Is there another way to bypass this?

Mark
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Close form automatically upon opening workbook

Mark,

To open a file without running the auto_open macro or the open event, use

Application.EnableEvents = False
Workbooks.Open f, , , , "PASSWORD"
Application.EnableEvents = True

HTH,
Bernie
MS Excel MVP


"Ixtreme" wrote in message
...
Hi,

I have a form that is being displayed automatically upon opening the
workbook (I have added the following code in the workbook open event:

Private Sub Workbook_Open()
FrmMain.Show
End Sub

However, I have another workbook that imports information from this
(and many copies of this) workbook). It automatically opens the
workbook, however it halts on the userform that is being displayed. Is
there a possibility that the form is closed with VBA code?

Currently I have:

Path = ActiveWorkbook.Path & "\IMPORT\"
ChDir Path
f = Dir(Path & "*.xls")
While f < ""

Workbooks.Open f, , , , "PASSWORD"
Unload FrmMain
Sheets("Overview").Activate

The code stops on Unload FrmMain. Is there another way to bypass this?

Mark



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Close form automatically upon opening workbook

On 18 sep, 14:39, "Bernie Deitrick" <deitbe @ consumer dot org wrote:
Mark,

To open a file without running the auto_open macro or the open event, use

Application.EnableEvents = False
Workbooks.Open f, , , , "PASSWORD"
Application.EnableEvents = True

HTH,
Bernie
MS Excel MVP

"Ixtreme" wrote in message

...



Hi,


I have a form that is being displayed automatically upon opening the
workbook (I have added the following code in the workbook open event:


Private Sub Workbook_Open()
FrmMain.Show
End Sub


However, I have another workbook that imports information from this
(and many copies of this) workbook). It automatically opens the
workbook, however it halts on the userform that is being displayed. Is
there a possibility that the form is closed with VBA code?


Currently I have:


Path = ActiveWorkbook.Path & "\IMPORT\"
ChDir Path
f = Dir(Path & "*.xls")
While f < ""


* *Workbooks.Open f, , , , "PASSWORD"
* *Unload FrmMain
* *Sheets("Overview").Activate


The code stops on Unload FrmMain. Is there another way to bypass this?


Mark- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


Thanks Bernie!

That is exactly what I needed. Great!

Kind regards,

Mark
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically close form before closing Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 0 September 19th 08 08:26 PM
Personal workbook not opening automatically JP[_4_] Excel Discussion (Misc queries) 0 December 4th 07 02:59 PM
SHow user form when opening workbook Wanna Learn Excel Discussion (Misc queries) 2 June 26th 07 06:30 PM
Form Numbers Automatically Increment by 1 Upon Opening GVDLS New Users to Excel 2 May 2nd 06 09:22 PM
automatically opening workbook Pinnacle Excel Discussion (Misc queries) 1 May 20th 05 12:48 AM


All times are GMT +1. The time now is 10:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"