Exit Sub causing excel to crash

cbrf23

Board Regular
Joined
Jun 20, 2011
Messages
241
I have a routine, its pretty lengthy and I dont know that its necessary to paste the code to describe the issue. I will if need be...

Anyways, there are basically two procedures that get run here. The the calling procedure gets some info, and creates an object of a custom class. The custom class runs one procedure, it exports all sheets in the workbook to the chosen directory in their own workbook and saved in their own folder. When its done it exits back to the calling procedure, and then the calling procedure ends (Exit Sub).

Everything works. If I step through the code using F8, everything works flawlessly. But, if I let the code run, when it tries to exit back to the calling procedure, excel crashes. Everytime. Without fail.

Now, whats wierd, is that If I let the code run on its own all the way up to "Exit Sub" line of the running procedure in the class module (I put a break line on this line), everything runs fine, and if I hit F8 to execute the "Exit Sub" line, no crash!

I even put message boxes in after each line of code at the end of both procedures, and let the code run on its own, so that I could pinpoint the exact line causing the crash. This confirmed it to be "Exit Sub" in the class module.

WTF? Anyone have any ideas why everything works pefectly if I hit F8 to execute that line of code, but not if I let the program run itself????

I'm very annoyed by this....Any help will be greatly appreciated!
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Re: Wierd Crashing Issue

Hey mods, why is there no option to edit the title? If you see this, could you change the title to "Exit Sub causing excel to crash?" I think that would be more helpful if someone is searching for a similar problem in the future....
Thanks!
 
Upvote 0
Re: Wierd Crashing Issue

If I click "What data does this errror report contain?" on the dialog asking if I want to send error report to MS, there is another hyperlink to "view the contents of the error report"

That tells me this:
Code: 0xc0000005 Flags: 0x00000000
Record: 0x0000000000000000 Address: 0x0000000000b1f5cb

Some googling tells me the above code is referring to an application trying to access memory through a bad pointer.

What I dont understand, is why this is happenning. Is there a problem with my programming, or with excel, or my operating system, or what?
 
Upvote 0
Re: Wierd Crashing Issue

After a bit more debugging (really, trial and error at this point) I found that if I disable the message box that I call at the end, it will run straight through.

I dont understand this. Its just a message box... it displays a list of what files and what directories were created. Thats it. Its got one button for OK. You hit OK, the program should mosey along....

Anyways, I'll have to play with this and see what I come up with...
 
Upvote 0
Re: Wierd Crashing Issue

Echo... I need a padded cell, all this talking to myself.

Well, I have no idea what the problem was, besides excel being glitchy ;) But I just created a new property for my class, set it to the string I was displaying in the message box, then display the message box from my calling procedure instead, and everything works. Go figure.

Its a bittersweet victory...happy it works, annoyed I dont understand what the problem was...
 
Upvote 0
Re: Wierd Crashing Issue

Not sure but for more rigid debugging you could try setting the options in your visual basic editor (under Tools | Options) to:

Break on all Errors
Break in Class Module

Class errors don't typically produce a break so it may really be something in your class. Lengthy code introduces more opportunities for mistakes - I don't mean to offend, but I'd assume its a vba programming error if this was my code. Though that doesn't mean it's necessarily easy to find or fix. The reporting you are sending MS is pretty low-level stuff and if there's no immediate feedback (in terms of MS sending you a link to a web page that addresses the problem) then it's probably irrelevant in the here and now.

ξ

Note that you have 10 minutes to edit a thread. After that, you can use the report button to report legitimate requests for edits to your thread.
 
Upvote 0
Re: Wierd Crashing Issue

Well, I have no idea what the problem was, besides excel being glitchy But I just created a new property for my class, set it to the string I was displaying in the message box, then display the message box from my calling procedure instead, and everything works. Go figure.

When you say "instead", instead of what? It's hard to really say much without more specific knowledge about what your code is doing. But if you're satisfied its working well enough now then that's fine. If you want to do more investigation we'll probably need to know more details.

ξ
 
Upvote 0
Re: Wierd Crashing Issue

Echo... I need a padded cell, all this talking to myself. ...

Hi All,

Sorry of no help, but I ccould not help but respond. My vote for line of the day:laugh:. Thanks!
 
Upvote 0
Hi guys,

Here is the code if anyone wants to take a look.... I can't find any errors, and get no errors from vba. But the message box at the end would cause the program to crash. If I put a breakline in at that line, and used f8 to step through, no crash. I ended up making the call of the message box its own procedure, which is called right after the export procedure from the calling procedure. (and made the report a property of the class) and have had no problems since.

If anyone could shed some light on this oddness that would be great.

Thanks.

Unfixed Code:
Code:
'*******************This goes in a normal module*******************
Option Explicit
Sub tstExport()
    Dim oE As ClaExporter2
    Dim strDesc As String
    Dim intMsg As Integer
    Dim intReply As Integer
    Dim intReply2 As Integer
    Dim strReport As String
 
    Set oE = New ClaExporter2
 
        With oE
                Do Until intReply = vbYes
                    intReply = 0
                    intMsg = 0
                    strDesc = vbNullString
 
                    On Error Resume Next
                    .Template = BrowseFile("Select the job template file.", ThisWorkbook.Path)
                    .OutputDir = BrowseFolder("Select the directory where the job folder should go.", ThisWorkbook.Path)
                    If GblnErr Then On Error GoTo err Else On err GoTo 0
 
                        If .Template = vbNullString Or .OutputDir = vbNullString Then
                                If .Template = vbNullString Then strDesc = "Please select the job template file."
                                If .OutputDir = vbNullString Then
                                        If strDesc = vbNullString Then
                                            strDesc = "Please select the directory where the job folder should go."
                                        Else
                                            strDesc = Left(strDesc, Len(strDesc) - 1) & " and the directory where the job folder should go."
                                        End If
                                End If
                            strDesc = strDesc & vbCrLf & vbCrLf & "Both a template and output directory are required."
                        End If
 
                        If strDesc = vbNullString Then intReply = MyMsgBox( _
                        Prompt:="Export processe cannot be stopped once begun." & vbCrLf & _
                        "Please verify your selections." & vbCrLf & vbCrLf & "     Selected template: " & vbCrLf & _
                        "     " & .Template & vbCrLf & "     Selected output directory: " & vbCrLf & "     " & .OutputDir _
                        & vbCrLf & vbCrLf & "Are these selections correct for this job?", _
                        Buttons:=vbExclamation + vbYesNo, _
                        Title:="Verify selections")
 
                        If intReply = vbNo Then strDesc = "Selections not verified."
 
                        If strDesc <> vbNullString Then intReply2 = MyMsgBox( _
                        Prompt:=strDesc & vbCrLf & "Would you like to retry selections?", _
                        Buttons:=vbQuestion + vbRetryCancel, _
                        Title:="Not ready to export")
 
                        If intReply2 = vbCancel Then
                            MyMsgBox _
                            Prompt:="User cancelled." & vbCrLf & "No file or folder changes were made.", _
                            Buttons:=vbCritical + vbOKOnly, _
                            Title:="Export cancelled"
                            Set oE = Nothing
                            Exit Sub
                        End If
                Loop
 
                With oE
                    .EntireWorkbook
                End With
 
        End With
 
    Set oE = Nothing
    Exit Sub
 
err:
MyMsgBox err.Number
End Sub
 
'*******************This goes in class module ClaExporter2*******************
Option Explicit
Private blnScreen           As Boolean
Private blnEvents           As Boolean
Private strW                As String
Private strO                As String
Private strER               As String
Public Property Get Template() As String
    Template = strW
End Property
Public Property Let Template(value As String)
    If Not value = "False" Then strW = value
End Property
Public Property Get OutputDir() As String
    OutputDir = strO
End Property
Public Property Let OutputDir(value As String)
    strO = value
End Property
Private Property Get TemplateName() As String
        With Me
             TemplateName = Mid(.Template, InStrRev(.Template, "\") + 1)
        End With
End Property
Private Property Get TemplateDir() As String
        With Me
            TemplateDir = Left(.Template, Len(.Template) - Len(TemplateName) + 1)
        End With
End Property
Private Property Get JobNo() As String
    With ThisWorkbook.Sheets("DATA ENTRY")
        JobNo = .Cells.Find(what:="JOB", After:=.Cells(1, 1), LookIn:=xlFormulas, _
        lookat:=xlWhole, searchorder:=xlByRows, searchdirection:=xlPrevious, MatchCase:=False).Offset(0, -1)
    End With
End Property
Sub EntireWorkbook()
    Dim wkbk                As Workbook
    Dim ws                  As Worksheet
    Dim wsWhere             As Worksheet
    Dim intX                As Integer
    Dim intX2               As Integer
    Dim strFileName         As String
    Dim strDone             As String
    Dim strOutDir           As String
    Dim strSaveDir          As String
    Dim strNoCreFiles       As String
    Dim strCreFiles         As String
    Dim strNoCreDirs        As String
    Dim strCreDirs          As String
    Dim strSubReport        As String
    Dim rngAddress          As Range
    Dim oPro                As ClaProtector
 
    Set oPro = New ClaProtector
 
        With Application
            .Calculation = xlManual
            blnScreen = .ScreenUpdating
            blnEvents = .EnableEvents
            .ScreenUpdating = False
            .EnableEvents = False
        End With
 
        If oBar Is Nothing Then
            Set oBar = New ClaProgressBar
            oBar.Show "Exporting Forms..."
        End If
    oBar.Update "Exporting Forms..."
 
    strOutDir = Me.OutputDir & "\" & JobNo
    On Error Resume Next
    err.Clear
    MkDir strOutDir
        If err.Number = 75 Then
            strNoCreDirs = strNoCreDirs & vbCrLf & "     " & strOutDir
        Else
            strCreDirs = strCreDirs & vbCrLf & "     " & strOutDir
        End If
    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
        For Each ws In ThisWorkbook.Worksheets
                With ws
                        Select Case ws.Name
                        Case "HELP", "QUERY DATA", "TABULAR DATA", "INPUT", "DATA ENTRY"
                        Case Else
                            intX = intX + 1
                        End Select
                End With
        Next
        For Each ws In ThisWorkbook.Worksheets
                With ws
                        Select Case .Name
                        Case "HELP", "QUERY DATA", "TABULAR DATA", "INPUT", "DATA ENTRY"
                        Case Else
                            intX2 = intX2 + 1
                            oBar.Update "Exporting: " & .Name & vbCrLf & vbCrLf & "Completed: " & strDone
 
                                strFileName = JobNo & "_" & .Name
                                Set rngAddress = TrueUsedRange(ws)
                                Set wkbk = Nothing
                                Do Until Not wkbk Is Nothing
                                    On Error Resume Next
                                    Set wkbk = Workbooks(TemplateName)
                                    If GblnErr Then On Error GoTo err Else On Error GoTo 0
                                        If wkbk Is Nothing Then Application.Workbooks.Open Me.Template
                                Loop
 
                                Set wsWhere = wkbk.Sheets("Sheet1")
 
                                With wsWhere
                                        With oPro
                                            .TheSheet = wsWhere
                                            .Remove
                                        End With
 
                                        On Error Resume Next
                                        TrueUsedRange(wsWhere).Clear
                                        rngAddress.Copy
                                        If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
                                        With .Range(rngAddress.Address)
                                            .PasteSpecial xlPasteValues
                                            .PasteSpecial xlPasteFormats
                                            .PasteSpecial xlPasteColumnWidths
                                        End With
                                    oPro.Protect
 
                                    strSaveDir = strOutDir & "\" & strFileName
                                    On Error Resume Next
                                    err.Clear
                                    MkDir strSaveDir
                                        If err.Number = 75 Then
                                            strNoCreDirs = strNoCreDirs & vbCrLf & "     " & strSaveDir
                                        Else
                                            strCreDirs = strCreDirs & vbCrLf & "     " & strSaveDir
                                        End If
                                    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
                                    On Error Resume Next
                                    err.Clear
                                        With .Parent
                                            .SaveAs Filename:=strSaveDir & "\" & strFileName, WriteResPassword:="mypassword", ReadOnlyRecommended:=True
                                            .Close savechanges:=False
                                                If err.Number = 1004 And Right(err.Description, Len("write reserved.")) = "write reserved." Then
                                                    strNoCreFiles = strNoCreFiles & vbCrLf & "     " & strFileName
                                                Else
                                                    strCreFiles = strCreFiles & vbCrLf & "     " & strFileName
                                                End If
                                        End With
                                    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
                                End With
                            strDone = strDone & vbCrLf & .Name
                            oBar.Update Done:=(intX2 / intX) * 100
                        End Select
                End With
        Next
    On Error Resume Next
    Workbooks(TemplateName).Close savechanges:=False
    err.Clear
    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
    Set oPro = Nothing
    oBar.Done
 
        If strCreDirs = vbNullString Then strCreDirs = "     none"
        If strNoCreDirs = vbNullString Then strNoCreDirs = "     none"
        If strCreFiles = vbNullString Then strCreFiles = "     none"
        If strNoCreFiles = vbNullString Then strNoCreFiles = "     none"
 
    strSubReport = "Created Directories: " & strCreDirs & vbCrLf & vbCrLf & _
    "Found Existing Directories: " & strNoCreDirs & vbCrLf & vbCrLf & _
    "Created Files: " & strCreFiles
        If Trim(strNoCreFiles) = "none" Then
            strReport = "All sheets were exported successfully." & vbCrLf & vbCrLf & strSubReport
        Else
            strReport = "Not all sheets were exported." & vbCrLf & vbCrLf & strSubReport & vbCrLf & vbCrLf & _
            "-----------------------------------" & vbCrLf & vbCrLf & _
            "The following were not exported because a file with the same name already exists:" & strNoCreFiles
        End If
 
    Application.ScreenUpdating = blnScreen
    Application.EnableEvents = blnEvents
    Application.Calculation = xlAutomatic
    MyMsgBox _
    Prompt:=strReport, _
    Buttons:=vbOKOnly, _
    Title:="Export report"
'***********EVERYTHING WOULD PLAY UP TO HERE***********
    Exit Sub '***********APPLICATION WOULD CRASH HERE************
err:
    Dim oErr    As ClaErrors
 
    Set oErr = New ClaErrors
        With oErr
            .errModule = "ClaExport"
            .errProcedure = "EntireWorkbook"
            .Error
        End With
    Set oErr = Nothing
End Sub
 
Upvote 0
I made the message box its own procedure, made the string for the prompt a property of the class, and I call the message box from the calling procedure, instead of at the end of the export procedure. Thats all I changed, everything else is the same. I get no errors, and no crashing.

Fixed Code:
Code:
'****************In any normal module***************
Sub tstExport()
    Dim oE As ClaExporter2
    Dim strDesc As String
    Dim intMsg As Integer
    Dim intReply As Integer
    Dim intReply2 As Integer
 
    Set oE = New ClaExporter2
 
        With oE
                Do Until intReply = vbYes
                    intReply = 0
                    intMsg = 0
                    strDesc = vbNullString
 
                    On Error Resume Next
                    .Template = BrowseFile("Select the job template file.", ThisWorkbook.Path)
                    .OutputDir = BrowseFolder("Select the directory where the job folder should go.", ThisWorkbook.Path)
                    If GblnErr Then On Error GoTo err Else On err GoTo 0
 
                        If .Template = vbNullString Or .OutputDir = vbNullString Then
                                If .Template = vbNullString Then strDesc = "Please select the job template file."
                                If .OutputDir = vbNullString Then
                                        If strDesc = vbNullString Then
                                            strDesc = "Please select the directory where the job folder should go."
                                        Else
                                            strDesc = Left(strDesc, Len(strDesc) - 1) & " and the directory where the job folder should go."
                                        End If
                                End If
                            strDesc = strDesc & vbCrLf & vbCrLf & "Both a template and output directory are required."
                        End If
 
                        If strDesc = vbNullString Then intReply = MsgBox( _
                        Prompt:="Export processe cannot be stopped once begun." & vbCrLf & _
                        "Please verify your selections." & vbCrLf & vbCrLf & "     Selected template: " & vbCrLf & _
                        "     " & .Template & vbCrLf & "     Selected output directory: " & vbCrLf & "     " & .OutputDir _
                        & vbCrLf & vbCrLf & "Are these selections correct for this job?", _
                        Buttons:=vbExclamation + vbYesNo, _
                        Title:="Verify selections")
 
                        If intReply = vbNo Then strDesc = "Selections not verified."
 
                        If strDesc <> vbNullString Then intReply2 = MsgBox( _
                        Prompt:=strDesc & vbCrLf & "Would you like to retry selections?", _
                        Buttons:=vbQuestion + vbRetryCancel, _
                        Title:="Not ready to export")
 
                        If intReply2 = vbCancel Then
                            MsgBox _
                            Prompt:="User cancelled." & vbCrLf & "No file or folder changes were made.", _
                            Buttons:=vbCritical + vbOKOnly, _
                            Title:="Export cancelled"
                            Set oE = Nothing
                            Exit Sub
                        End If
                Loop
 
                With oE
                    .EntireWorkbook
                    .ShowReport
                End With
 
        End With
 
    Set oE = Nothing
    Exit Sub
 
err:
MsgBox err.Number
End Sub
 
'*************************In class module ClaExporter2*************
Option Explicit
Private blnScreen           As Boolean
Private blnEvents           As Boolean
Private strW                As String
Private strO                As String
Private strER               As String
Public Property Get Template() As String
    Template = strW
End Property
Public Property Let Template(value As String)
    If Not value = "False" Then strW = value
End Property
Public Property Get OutputDir() As String
    OutputDir = strO
End Property
Public Property Let OutputDir(value As String)
    strO = value
End Property
Private Property Get TemplateName() As String
        With Me
             TemplateName = Mid(.Template, InStrRev(.Template, "\") + 1)
        End With
End Property
Private Property Get TemplateDir() As String
        With Me
            TemplateDir = Left(.Template, Len(.Template) - Len(TemplateName) + 1)
        End With
End Property
Private Property Get JobNo() As String
    With ThisWorkbook.Sheets("DATA ENTRY")
        JobNo = .Cells.Find(what:="JOB", After:=.Cells(1, 1), LookIn:=xlFormulas, _
        lookat:=xlWhole, searchorder:=xlByRows, searchdirection:=xlPrevious, MatchCase:=False).Offset(0, -1)
    End With
End Property
Sub EntireWorkbook()
    Dim wkbk                As Workbook
    Dim ws                  As Worksheet
    Dim wsWhere             As Worksheet
    Dim intX                As Integer
    Dim intX2               As Integer
    Dim strFileName         As String
    Dim strDone             As String
    Dim strOutDir           As String
    Dim strSaveDir          As String
    Dim strNoCreFiles       As String
    Dim strCreFiles         As String
    Dim strNoCreDirs        As String
    Dim strCreDirs          As String
    Dim strSubReport        As String
    Dim rngAddress          As Range
    Dim oPro                As ClaProtector
 
    Set oPro = New ClaProtector
 
        With Application
            .Calculation = xlManual
            blnScreen = .ScreenUpdating
            blnEvents = .EnableEvents
            .ScreenUpdating = False
            .EnableEvents = False
        End With
 
        If oBar Is Nothing Then
            Set oBar = New ClaProgressBar
            oBar.Show "Exporting Forms..."
        End If
    oBar.Update "Exporting Forms..."
 
    strOutDir = Me.OutputDir & "\" & JobNo
    On Error Resume Next
    err.Clear
    MkDir strOutDir
        If err.Number = 75 Then
            strNoCreDirs = strNoCreDirs & vbCrLf & "     " & strOutDir
        Else
            strCreDirs = strCreDirs & vbCrLf & "     " & strOutDir
        End If
    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
        For Each ws In ThisWorkbook.Worksheets
                With ws
                        Select Case ws.Name
                        Case "HELP", "QUERY DATA", "TABULAR DATA", "INPUT", "DATA ENTRY"
                        Case Else
                            intX = intX + 1
                        End Select
                End With
        Next
        For Each ws In ThisWorkbook.Worksheets
                With ws
                        Select Case .Name
                        Case "HELP", "QUERY DATA", "TABULAR DATA", "INPUT", "DATA ENTRY"
                        Case Else
                            intX2 = intX2 + 1
                            oBar.Update "Exporting: " & .Name & vbCrLf & vbCrLf & "Completed: " & strDone
 
                                strFileName = JobNo & "_" & .Name
                                Set rngAddress = TrueUsedRange(ws)
                                Set wkbk = Nothing
                                Do Until Not wkbk Is Nothing
                                    On Error Resume Next
                                    Set wkbk = Workbooks(TemplateName)
                                    If GblnErr Then On Error GoTo err Else On Error GoTo 0
                                        If wkbk Is Nothing Then Application.Workbooks.Open Me.Template
                                Loop
 
                                Set wsWhere = wkbk.Sheets("Sheet1")
 
                                With wsWhere
                                        With oPro
                                            .TheSheet = wsWhere
                                            .Remove
                                        End With
 
                                        On Error Resume Next
                                        TrueUsedRange(wsWhere).Clear
                                        rngAddress.Copy
                                        If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
                                        With .Range(rngAddress.Address)
                                            .PasteSpecial xlPasteValues
                                            .PasteSpecial xlPasteFormats
                                            .PasteSpecial xlPasteColumnWidths
                                        End With
                                    oPro.Protect
 
                                    strSaveDir = strOutDir & "\" & strFileName
                                    On Error Resume Next
                                    err.Clear
                                    MkDir strSaveDir
                                        If err.Number = 75 Then
                                            strNoCreDirs = strNoCreDirs & vbCrLf & "     " & strSaveDir
                                        Else
                                            strCreDirs = strCreDirs & vbCrLf & "     " & strSaveDir
                                        End If
                                    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
                                    On Error Resume Next
                                    err.Clear
                                        With .Parent
                                            .SaveAs Filename:=strSaveDir & "\" & strFileName, WriteResPassword:="PASSWORD", ReadOnlyRecommended:=True
                                            .Close savechanges:=False
                                                If err.Number = 1004 And Right(err.Description, Len("write reserved.")) = "write reserved." Then
                                                    strNoCreFiles = strNoCreFiles & vbCrLf & "     " & strFileName
                                                Else
                                                    strCreFiles = strCreFiles & vbCrLf & "     " & strFileName
                                                End If
                                        End With
                                    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
                                End With
                            strDone = strDone & vbCrLf & .Name
                            oBar.Update Done:=(intX2 / intX) * 100
                        End Select
                End With
        Next
    On Error Resume Next
    Workbooks(TemplateName).Close savechanges:=False
    err.Clear
    If GblnErr Then On Error GoTo err Else On Error GoTo 0
 
    Set oPro = Nothing
    oBar.Done
 
        If strCreDirs = vbNullString Then strCreDirs = "     none"
        If strNoCreDirs = vbNullString Then strNoCreDirs = "     none"
        If strCreFiles = vbNullString Then strCreFiles = "     none"
        If strNoCreFiles = vbNullString Then strNoCreFiles = "     none"
 
    strSubReport = "Created Directories: " & strCreDirs & vbCrLf & vbCrLf & _
    "Found Existing Directories: " & strNoCreDirs & vbCrLf & vbCrLf & _
    "Created Files: " & strCreFiles
        If Trim(strNoCreFiles) = "none" Then
            ExportReport = "All sheets were exported successfully." & vbCrLf & vbCrLf & strSubReport
        Else
            ExportReport = "Not all sheets were exported." & vbCrLf & vbCrLf & strSubReport & vbCrLf & vbCrLf & _
            "-----------------------------------" & vbCrLf & vbCrLf & _
            "The following were not exported because a file with the same name already exists:" & strNoCreFiles
        End If
 
    Application.ScreenUpdating = blnScreen
    Application.EnableEvents = blnEvents
    Application.Calculation = xlAutomatic
 
    Exit Sub
err:
    Dim oErr    As ClaErrors
 
    Set oErr = New ClaErrors
        With oErr
            .errModule = "ClaExport"
            .errProcedure = "EntireWorkbook"
            .Error
        End With
    Set oErr = Nothing
End Sub
Private Property Get ExportReport() As String
    ExportReport = strER
End Property
Private Property Let ExportReport(value As String)
    strER = value
End Property
Sub ShowReport()
    MsgBox _
    Prompt:=ExportReport, _
    Buttons:=vbOKOnly, _
    Title:="Export report"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top