The paper reconstructs Frege's criticism of the ontological argument for the existence of God on the basis of various remarks scattered in his writings. The material is organized in such a way as to: (a) reveal a logical structure of the argument; (b) show and discern various presupposition of a logical, semantical and ontological character; and (c) indicate some essential weaknesses of the ontological argument. It is argued that Frege's critical commentaries on this argument are essentially connected to four solutions, stating that: (1) the difference between a name and a predicate is categorical; (2) the existential judgement possesses a different logical structure than the singular judgement; (3) in the characteristic of concepts marks and properties should be distinguished; (4) the ascription of number contains the statement about a concept. In order to make Frege's argumentation as understandable as possible it is confronted with Kant's criticism of ontological argument. The analysis carried on in the above-described way reveals a number of shortcomings which discredit the ontological argument. For example, the paper shows that the analysis of predication of oneness (Einzigkeit) does not lead to the affirmation of God's existence. Moreover, it shows that in that argument the term God is used in two different semantic roles; that some theses that should constitute the argument's conclusion, are already assumed; and that sense-condition and truth-conditions are not distinguished.