+ Reply to Thread
Results 1 to 4 of 4

Userforms keep popping up, need code to stop it

  1. #1
    rammieib
    Guest

    Userforms keep popping up, need code to stop it

    Hey

    I've tried unsuccessfully to stop userforms coming up in the following
    code. What can I put in in the different places to stop the userforms
    appearing (or the suerform appears and the clcik on the userform button
    to happen automatically with screen application off.) Thanks.

    Sub opensesame()
    Dim change As Variant

    clear2

    Application.Dialogs(xlDialogOpen).Show USERFORM APPEARS HERE
    Application.ScreenUpdating = False
    change = ActiveWorkbook.Name
    Cells.Select
    Selection.Copy
    ActiveWindow.ActivateNext USERFORM APPEARS HERE
    Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    SkipBlanks _
    :=False, Transpose:=False
    Range("A1").Select
    Workbooks(change).Activate USERFROM APPEARS HERE
    Application.CutCopyMode = False
    Application.DisplayAlerts = False
    ActiveWorkbook.Close USERFROM APPEARS HERE
    Application.ScreenUpdating = True
    On Error Resume Next
    Set rng = Application.InputBox( _
    "Select Range to Examine, this will be the range over which your
    previous grid ran", Type:=8)
    Application.ScreenUpdating = False
    On Error Resume Next
    If rng Is Nothing Then Exit Sub
    rng.Select
    Selection.RowHeight = 15
    Selection.ColumnWidth = 1.5


    rng.Select
    etc etc etc

    End Sub


  2. #2
    Toppers
    Guest

    RE: Userforms keep popping up, need code to stop it

    When I ran your code I only got the XlDialogOpen form (as expected).

    What (other) userform(s) appears? What does "Clear2" do?

    XL2003

    "rammieib" wrote:

    > Hey
    >
    > I've tried unsuccessfully to stop userforms coming up in the following
    > code. What can I put in in the different places to stop the userforms
    > appearing (or the suerform appears and the clcik on the userform button
    > to happen automatically with screen application off.) Thanks.
    >
    > Sub opensesame()
    > Dim change As Variant
    >
    > clear2
    >
    > Application.Dialogs(xlDialogOpen).Show USERFORM APPEARS HERE
    > Application.ScreenUpdating = False
    > change = ActiveWorkbook.Name
    > Cells.Select
    > Selection.Copy
    > ActiveWindow.ActivateNext USERFORM APPEARS HERE
    > Range("A1").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Range("A1").Select
    > Workbooks(change).Activate USERFROM APPEARS HERE
    > Application.CutCopyMode = False
    > Application.DisplayAlerts = False
    > ActiveWorkbook.Close USERFROM APPEARS HERE
    > Application.ScreenUpdating = True
    > On Error Resume Next
    > Set rng = Application.InputBox( _
    > "Select Range to Examine, this will be the range over which your
    > previous grid ran", Type:=8)
    > Application.ScreenUpdating = False
    > On Error Resume Next
    > If rng Is Nothing Then Exit Sub
    > rng.Select
    > Selection.RowHeight = 15
    > Selection.ColumnWidth = 1.5
    >
    >
    > rng.Select
    > etc etc etc
    >
    > End Sub
    >
    >


  3. #3
    rammieib
    Guest

    Re: Userforms keep popping up, need code to stop it

    Toppers

    Hiya. clear2 is just a macro which clears my current sheet of any data,
    I should have taken it out.

    The workbook has a userform which automatically appears whenever you
    open the workbook up. I want to stop this automatically happening as in
    this macro I am changing between workbooks.

    Hope that makes sense.

    I didn't post the whole macro in.


  4. #4
    Art H
    Guest

    Re: Userforms keep popping up, need code to stop it

    I think you need:
    Application.EnableEvents = False
    Remember to enable events when finished opening workbooks--also in any
    error handlers.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1