sub is getting ignored from call subs

jaik22

Board Regular
Joined
Sep 23, 2016
Messages
102
Code:
Sub savereport()


Application.DisplayAlerts = False
Application.ScreenUpdating = False


ChDrive Left(ActiveWorkbook.Path, 2)
ChDir ActiveWorkbook.Path


SaveAsName = Application.GetSaveAsFilename(FileFilter:="Excel Files (*.xlsx), *.xlsx")
    If SaveAsName <> False Then


ActiveWorkbook.SaveAs Filename:=SaveAsName, FileFormat:= _
xlOpenXMLWorkbook, WriteResPassword:="testing", ReadOnlyRecommended:=False _
, CreateBackup:=False


        ElseIf SaveAsName = False Then
        MsgBox ("User cancelled saving")
        Exit Sub
    End If
Application.DisplayAlerts = True


End Sub

Code:
sub starting()
Call importreport
Call formatreport
Call savereport
End Sub

I have savereport sub to save my excel file as reserved file. However after adding if statement, my sub is no longer working from sub starting.
If I run just savereport it works fine, but It gets ignored when I run starting sub. Does anyone has idea what's wrong with this code?

Thank you!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Have you changed anything in the other 2 subs it's calling?
It sounds as the if the macro is quitting before it gets to the final call
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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