
538 P.2d 152 (1975)
MONROE, LTD., a corporation, Appellant,
v.
CENTRAL TELEPHONE COMPANY, SOUTHERN NEVADA DIVISION, et al., Respondents.
No. 7627.
Supreme Court of Nevada.
July 10, 1975.
*153 Daryl Engebregson, Las Vegas, for appellant.
Neil J. Beller, Las Vegas, for respondents.

OPINION
BATJER, Justice:
Appellant filed a complaint against Central Telephone Company, Southern Nevada Division, hereafter referred to as respondent, and one other party on October 11, 1968. The other party settled and the action was dismissed as to it by district court order entered on December 2, 1968, pursuant to a stipulation. Respondent filed its answer on August 1, 1969. No other action was taken until September 12, 1973, when appellant filed a note for trial docket. On September 21, 1973, appellant moved for a trial setting before October 11, 1973, and attached to that motion an affidavit, in justification of the preferential setting, which explained that the five year period since the filing of the complaint would expire on October 11, 1973. NRCP 41(e). The motion for trial setting was denied by Judge Compton on September 26, 1973.
1. Although the record does not include any written motion for dismissal filed by appellant, nor a certificate of service of such motion upon respondent, the ex parte order entered by Judge Compton on October 9, 1973, and filed on October 16, 1973, (NRCP 41(a)(2))[1] dismissing appellant's complaint without prejudice recites that it was entered on the motion of appellant.[2]
On October 12, 1973, respondent filed a motion to dismiss the action, with prejudice, for appellant's failure to prosecute, and on October 17, 1973, respondent filed a motion to vacate Judge Compton's ex parte order of dismissal. Both motions were served by mail. Respondent's motions were heard and granted on October 24, 1973 by Judge Pavlikowski. This appeal followed.
*154 NRCP 7(b)(1)[3] requires that a motion shall be in writing unless made during a hearing or trial, and NRCP 5(a)[4] mandates that every written motion other than one that may be heard ex parte shall be served upon each of the parties. No hearing or trial was in progress involving this case on October 9, 1973, when the ex parte order was entered.[5] The requirement of a written motion stating the grounds with particularity is intended to guarantee that the adverse party be informed not only of its pendency, but also the basis upon which the movant seeks the order.
A motion for dismissal under NRCP 41(a)(2) may not be heard ex parte, but is a matter for the exercise of sound discretion by the trial court to either grant or refuse upon the facts presented. Wilson & Co. v. Fremont Cake & Meal Co., 83 F. Supp. 900 (D.Neb. 1949); Pratt v. Rice, 7 Nev. 123 (1871); Wright & Miller, Federal Practice and Procedure: Civil § 912. Cf. Larsen v. Switzer, 183 F.2d 850 (8th Cir.1950), cert. denied, 340 U.S. 911, 71 S.Ct. 291, 95 L.Ed. 658 (1951).
Here respondent contends that it knew nothing of the motion until a copy of the ex parte order was received by mail several days after its entry. In Maheu v. District Court, 88 Nev. 26, 34, 493 P.2d 709, 714 (1972), we reviewed this court's historical view of ex parte orders: "For a century, our settled law has been that any `special' motion involving judicial discretion that affects the rights of another, as contrasted to motions `of course,' must be made on notice even where no rule expressly requires notice to obtain the particular order sought, except only when this requirement is altered to meet extraordinary situations such as those concerned in NRCP 65(b). Pratt v. Rice, 7 Nev. 123 (1871); NRCP 6(d). It is also fundamental that although an order's subject matter would lie within the court's jurisdiction if properly applied for, it is void if entered without required notice. Our authorities establishing this principle are as old as Wilde v. Wilde, 2 Nev. 306 (1866), and as recent as Reno Raceways, Inc. v. Sierra Paving, Inc., 87 Nev. 619, 492 P.2d 127 (1971). It makes no difference that a void order may concern a matter committed to the court's discretion, such as `discovery,' regarding which the court might have granted protective orders had a proper application been made. Cf. Checker, Inc., v. Public Serv. Commn., 84 Nev. 623, 446 P.2d 981 (1968); cf. Ray v. Stecher, 79 Nev. 304, 383 P.2d 372 (1963); cf. Whitney v. District Court, 68 Nev. 176, 227 P.2d 960 (1951); cf. Abell v. District Court, 58 Nev. 89, 71 P.2d 111 (1937)."
The failure of appellant to comply with the requirements of NRCP 7(b) and NRCP 5(a) deprived Judge Compton of authority to proceed to enter the order on October 9, 1973, dismissing the action without prejudice. The act of Judge Compton in entering the ex parte order was erroneous[6] since the motion should have been in writing and on notice.
*155 In its motion to vacate the ex parte order, respondent alleged as grounds appellant's failure to file and serve a notice of motion and motion to dismiss. Failure to comply with court rules is a valid ground for vacating an order. See In the Matter of the Estate of Powell, 62 Nev. 10, 135 P.2d 435 (1943). Cf. F.C. Mortimer v. P.S.E. & L. Co., supra, and Luc v. Oceanic Steamship Company, supra, footnote 6. Whether the ex parte order was void or voidable is not material to this opinion because it was properly vacated by Judge Pavlikowski.
Appellant registered no objection to Judge Pavlikowski's presiding at the hearing on October 24, 1973. Now, for the first time, it contends that D.C.R. 26[7] was violated and error committed. It is unnecessary to decide this point as it was not raised in the district court and is not properly before us. Eagle Thrifty Dr. & Mkts., Inc. v. Incline Village, Inc., 89 Nev. 575, 517 P.2d 786 (1973). Cf. Cottonwood Cove Corp. v. Bates, 86 Nev. 751, 476 P.2d 171 (1970).
After Judge Pavlikowski vacated the ex parte order, the matter was before him on respondent's motion to dismiss for lack of prosecution. At that time the case was viable, pending and ripe for dismissal. NRCP 41(e).[8]
Dismissal of an action pending for more than five years is mandatory in the absence of written stipulation for an extension of time. Lighthouse v. Great W. Land & Cattle, 88 Nev. 55, 493 P.2d 296 (1972).
Judge Pavlikowski did not abuse his discretion in dismissing with prejudice. The purpose of Rule 41(a)(2) is to compel reasonable diligence in the prosecution of an action. Where a defendant has made a prima facie showing of unreasonable delay, the plaintiff must show circumstances excusing delay. Hassett v. St. Mary's Hosp. Ass'n., 86 Nev. 900, 478 P.2d 154 (1970). Here appellant has failed to present a valid excuse.
2. In its challenge to the order of September 26, 1973, denying the motion for *156 preferential trial setting, appellant contends that Judge Compton erred. However, it was appellant who delayed filing its application for a trial until just before dismissal would have been required under NRCP 41(e). The diligence required on the part of appellant and its counsel is absent in this record. No valid reason or explanation was given for the pendency of this case for some four years after it had been at issue.
Setting trial dates and other matters done in the arrangement of a trial court's calendar is within the discretion of that court, and in the absence of arbitrary conduct will not be interfered with by this court. Close v. Second Judicial Dist. Court, 73 Nev. 194, 314 P.2d 379 (1957). Cf. State ex rel. Hamilton v. Second Judicial Dist. Court, 80 Nev. 158, 390 P.2d 37 (1964). We find no error or abuse of discretion by Judge Compton in his order denying appellant a preferential trial setting.
The orders of the district court are affirmed.
GUNDERSON, C.J., and MOWBRAY, THOMPSON and GREGORY, JJ., concur.
NOTES
[1]  NRCP 41 (a) (2): "Except as provided in paragraph (1) of this subdivision of this rule, an action shall not be dismissed at the plaintiff's instance save upon order of the court and upon such terms and conditions as the court deems proper. If a counterclaim has been pleaded by a defendant prior to the service upon him of the plaintiff's motion to dismiss, the action shall not be dismissed against the defendant's objection unless the counterclaim can remain pending for independent adjudication by the court. Unless otherwise specified in the order, a dismissal under this paragraph is without prejudice."
[2]  Although the ambiguous phrase "at the plaintiff's instance" is used in NRCP 41(a) (2), those words contemplate that the plaintiff will present a motion to the trial court. Diamond v. United States, 267 F.2d 23, 25, (5th Cir.1959), cert. denied, 361 U.S. 834, 80 S.Ct. 85, 4 L.Ed.2d 75 (1959).
[3]  NRCP 7(b)(1): "An application to the court for an order shall be by motion which, unless made during a hearing or trial, shall be made in writing, shall state with particularity the grounds therefor, and shall set forth the relief or order sought. The requirement of writing is fulfilled if the motion is stated in a written notice of the hearing of the motion."
[4]  NRCP 5(a) provides in pertinent part: "... [E]very written motion other than one which may be heard ex parte, and every written notice, appearance, demand, offer of judgment, designation of record on appeal, and similar paper shall be served upon each of the parties... ."
[5]  The type of hearing at which there is no need to reduce a motion to writing is one in which the proceedings are recorded. Alger v. Hayes, 452 F.2d 841 (C.A.8th 1972).
[6]  In F.C. Mortimer v. P.S.S. & L. Co., 62 Nev. 142, 145 P.2d 733 (1944), this court held an order invalid because it had been made without notice and an opportunity for hearing. In Luc v. Oceanic Steamship Company, 84 Nev. 576, 579, 445 P.2d 870, 872 (1968), we said: "The giving of notice is a jurisdictional requirement, and where a rule or statute prescribes the manner in which notice is to be given, that mode must be complied with or the proceeding will be a jurisdictional nullity." In Turner v. Saka, 90 Nev. 54, 518 P.2d 608 (1974), we considered an "Order to Show Cause" issued in the State of New Jersey void for want of notice.
[7]  D.C.R. 26: "1. Except as otherwise provided in subsection 2 of this rule, when any district judge shall have entered upon the trial or hearing of any cause, proceeding or motion, or made any ruling, order or decision therein, no other judge shall do any act or thing in or about such cause, proceeding or motion, unless upon the written request of the judge who shall have first entered upon the trial or hearing of such cause, proceeding or motion.

"2. The judges in any judicial district having more than one judge shall adopt such rules as they deem necessary to provide for the division and disposal of the business of their judicial district."
[8]  NRCP 41(e): "The court may in its discretion dismiss any action for want of prosecution on motion of the defendant and after due notice to the plaintiff, whenever plaintiff has failed for two years after action is filed to bring such action to trial. Any action heretofore or hereafter commenced shall be dismissed by the court in which the same shall have been commenced or to which it may be transferred on motion of the defendant, after due notice to plaintiff or by the court upon its own motion, unless such action is brought to trial within five years after the plaintiff has filed his action, except where the parties have stipulated in writing that the time may be extended. When, in any action after judgment, a motion for a new trial has been made and a new trial granted, such action shall be dismissed on motion of defendant after due notice to plaintiff, or by the court of its own motion, if no appeal has been taken, unless such action is brought to trial within three years after the entry of the order granting a new trial, except when the parties have stipulated in writing that the time may be extended. When in an action after judgment, an appeal has been taken and judgment reversed with cause remanded for a new trial (or when an appeal has been taken from an order granting a new trial and such order is affirmed on appeal), the action must be dismissed by the trial court on motion of defendant after due notice to plaintiff, or of its own motion, unless brought to trial within three years from the date upon which remittitur is filed by the clerk of the trial court. A dismissal under this subdivision (e) is a bar to another action upon the same claim for relief against the same defendants unless the court otherwise provides.
