Before the trial of this cause the defendant moved for judgment upon the pleadings. The court denied the motion, and the action of the court is enumerated as “one of the errors of law occurring during the trial,” in the specification of errors attached to the statement on motion for a new trial. An order of the court made before trial cannot be an “error'of law occurring during the progress of the trial,” and therefore is not an error of law which can be made a ground for a new trial. (See *149Scherrer v. Hale, ante, page 63, decided at tbis term of court.) But the defendant, upon the trial, objected ,to the admission of testimony, and the grounds upon which the objections were made are similar to those upon which the motion was based, and they are thus, by virtue of his . exceptions and specifications of error, properly before this court.
The first claim made by the defendant attacks the right of the plaintiff to sue. Since the decision of the case of Paul v. Virginia, 8 Wall. 168, the doctrine has been well settled that, subject to certain exceptions, a State may prescribe the terms upon which foreign corporations, including corporations organized under the laws of a sister State, shall carry on business within its borders. This rule, with the exceptions, is thus briefly and clearly announced «by that eminent jurist, Mr, Justice Field: “The only limitation upon this power of the State to exclude a foreign corporation from doing business within its limits, or hiring offices for that purpose, or to exact conditions for allowing the corporation to do business or hire offices there, arises where the corporation is in the employ of the federal government, or where its business is strictly commerce, interstate, or foreign.” (See Pembina Mining Co. v. Pennsylvania, 125 U. S. 181, and cases cited.) This rule is not questioned, and the validity of the territorial law is not attacked by the respondent, the plaintiff corporation. It maintains, however, that the law does not prohibit the maintenance of a suit by a corporation in this Territory, because such corporation has failed to comply with the law. This position, we think, is correct. It is well settled that, by the comity of nations, a corporation erected by one sovereignty may carry on business in another, and may sue in its courts (see Taney, C. J., in Bank v. Earle, 13 Peters, 519); and the statute of our Territory takes away the former, and not the latter, power. Even upon a contract made in violation of the law, the question for the court to decide would be, not the right of plaintiff to sue, but the validity of the cause of action.
We think that counsel for defendant does not reason correctly upon this point. He looks to the penalty in order to discover what is prohibited by the law, instead of looking at the prohibition, and then applying the penalty. That which is prohibited is the conducting of business; and, when the law is violated, *150tben all “acts and contracts” in tbe conduct of business are void. But these acts which are void are the acts and contracts of the corporation. The statute does not mean that a corporation cannot protect its property; does not allow others to confiscate the property of the corporation. If the appellant is correct, if a foreign corporation which has failed to comply with section 442 cannot sue in our courts, then it cannot defend; because the defense of a suit is the “ act ” of the corporation to the same extent as is the prosecution of a suit. If it cannot defend, any suit, however unjust, however outrageous, can successfully be maintained against it; for it cannot testify, it cannot interpose an answer, since that would be an act. If it cannot sue, there will be no remedy in its behalf for property stolen from it. The law does not prohibit such a corporation from coming within the limits of our jurisdiction. It merely declares that it shall do no business until it complies with certain requirements. The prohibition applies to its business, which means the carrying out of those purposes for which such corporation was organized. All the cases cited by the appellant depend upon this theory. In no case cited did the court decide that the corporation had no authority to sue. The reason given in each case was that the contract was void as against the public policy, as declared by statute, and therefore could not be enforced. (See Cooper Manuf. Co. v. Ferguson, 113 U. S. 727-733.)
The point is clearly raised when applied to cases for tort where there is no contract, and where the act complained of was directed against a corporation. In the case of Utley v. Clark-Gardner Mining Co. 4 Colo. 369, which was an action to recover damages for trespass, the defendant on appeal was the plaintiff in the court below, and was a corporation organized under the -laws of New York. It had failed to comply with the laws of Colorado, which required the filing of a certificate similar to that mentioned in section 442, and which prohibits a foreign 'Corporation from carrying on “any business” until such certificate is filed. The law is so similar to ours that one is led to believe that it is the statute from which ours is derived. In considering the question of the capacity of the corporation to sue, and fully admitting the validity of the law, and that it was prohibitory to the full extent of the terms thereof, the court say: “ Ordinarily *151they [corporations] have the power to sue; the power to contract limited to the objects of the company; and the power to acquire, as well as to hold and enjoy, real and personal property, limited to the necessities of the company. Taking language in its ordinary acceptation, a corporation does business by the exercise of its power to contract, its power to acquire and hold property, real and personal, and like powers. By the exercise of their corporate powers it carries on its corporate business in the ordinary meaning of the term. By their exercise it establishes its business relations, assumes obligations, and acquires rights. By its power to sue it does not seek to do business, as that term is generally understood, but enforce rights springing from business transactions. By the comity of States composing the Union a corporation created by the laws of one State may exercise all the enumerated powers in any other State, in the absence of any prohibitory statute or conflicting policy. (Story on Constitutional Laws, § 38.) Our prohibitory statute must be interpreted with reference to this general doctrine, and language affecting the capacity of a company to contract or acquire real or personal property must not be enlarged to prohibit the exercise of another and independent power, that might be exercised by virtue of this general rule or comity which existed prior to the adoption of the statute. The question is, how far is this general rule modified or abridged by the statute? The prohibition extends to doing business before compliance with the terms of the statute. We do not think this an abridgment of the right of a foreign corporation to sue. It extends only to the exercise of the powers by which it may be said to ordinarily transact or carry on its business.”
We are of the opinion that the statute prohibits merely the carrying on of business; that the penalty for violating the law is that the acts and contracts in the course of such business are void; but that the law does not deprive a foreign corporation of any right to sue, although the law may prevent the enforcement of any contract by such foreign corporations as refuse to comply with the law. It will be observed that the cause of action is not based upon any act of the plaintiff corporation, but upon the alleged illegal act of the defendant. It must be further remembered that the action is really based upon a tort, *152although, by a fiction of law, it is an action, “sounding in contract.”
We are of the opinion, as we have already intimated, that this action is not based upon any act or contract of the plaintiff declared void by the statute, because it is not an act or contract made by the plaintiff in the conduct of his business; and that, as far as this point is concerned, plaintiff could maintain this cause of action.
The next point made by the appellant is that the plaintiff has never presented its claim to the board of county commissioners, which appellant claims is a condition precedent to the commencement of an action against any county. Appellant relies upon sections 762 to 764, division 5, Compiled Statutes. Counsel for respondent has cited many cases under statutes differing from ours, which hold that under those statutes no demand is necessary. The general principle has been settled by this court in-a recent case (see First Nat. Bank v. Custer County, 7 Mont. 464), and the doctrine there announced is supported by cases in California under statutes similar to ours. (See Rhoda v. Alameda County, 52 Cal. 350.)
Counsel for respondent also claims that the law applies strictly to “accounts,” as the word is used in section 762; accounts involving items. With this we do not agree. Section 764 provides for the appeal from the decision of the county commissioners, and there the word used is “claim,” and section 777 gives the commissioners power to summon witnesses “whom they may deem necessary to examine in the investigation of any account or claim against the county.” It is made the duty of the county commissioners to settle the indebtedness . of. the county, to authorize the payment of the debt by an order upon the county treasurer, who can pay money only upon such order, except “ when specified provision for the payment thereof is or shall be otherwise made by law” (see § 891); and the county treasurer cannot even pay a judgment without the proper voucher for the payment (see § 751); and the proper voucher would seem to be the order of the board of commissioners. The purpose of the statute is quite apparent. It is to protect the people from unjust payments ordered by the commissioners, and to protect them from unnecessary expenses of litigation. Any *153tax-payer may appeal from any order made by the board, and directing the payment of money (§ 764); and, on the other hand, the board is authorized to pass upon all claims for the payment of money against the county, and thus avoid the unnecessary costs involved in an action at law in all cases where they consider the demand just and legal. The demands against a county are numerous; and it is only just and proper that the representatives of the county should have an opportunity to examine and pass upon such accounts or demands before they are made the subject of an action at law. (See Luzerne County v. Day, 23 Pa. St. 141; Lawrence County v. City of Brookhaven, 51 Miss. 68.) In the case of Hohman v. Comal County, 34 Tex. 36, under a different statute, the court gives the reason for the law, that the policy of the law is to pi ace the commissioners in the' same positions as executors and administrators, npon whom a demand must be made before they can be made defendants in an action for debt.
Counsel cites the case of Stringham v. Winnebago County, 24 Wis. 603, in which the court say that it was not the purpose of the legislature that the law should apply to claims arising out of a tort. The court bases its opinion upon the impracticability of a rule which obliges the commissioners to decide grave questions of law, and to investigate many issues of fact. With great respect for the opinion of the court of Wisconsin, we can find no force in that reason. Accounts based upon contracts involve questions of law. The question of the salary of an officer involves the interpretation of statutes, as our own reports will show, and such questions are plainly within the requirements of the statute. Moreover, the board of county commissioners has its legal adviser, the attorney for the county; and we cannot see that intricate questions of fact are apt to arise more frequently in actions of tort than in actions of contract. Moreover, the board has power to summon and investigate any witness who can throw light upon the subject. (See, also, upon this very question, Maddox v. Randolph County, 65 Ga. 216.)
We are of the opinion that this cause must be remanded for a new trial, because the proper demand was not made.
There are other questions before us in this cause. We refuse to pass upon them, and have avoided stating them and the facts *154upon which they are .based, because they involve the interests of the public .in grave and serious matters, and because they are not necessary to a reversal of this cause, and because the point already passed upon may, for aught we know, finally dispose of the action.
Blake, C. J., and De Wolfe, J., concur.