David was nearing the end of his life and he knew it. Earlier David brought the ark of God from the house of Obed-Edom to Jerusalem where he had prepared a tabernacle for it. David's desire was to build a house for the ark of the covenant of the Lord. He was a worshiper who loved the Lord with all that he was. His motive was not selfish, but flowed from a heart that was set on and sought after the Lord's own heart.
Although his motive was pure God did not allow him to follow through. The Lord sent the prophet Nathan to David with these words, "You shall not build Me a house to dwell in. And it shall be when your days are fulfilled, when you must go to be with your fathers, that I will set up your seed after you, who will be of your sons; and I will establish his kingdom. He shall build Me a house, and I will establish his throne forever" (1 Chronicles 17.4, 11-12). David was humbled and greatly rejoiced at the words of God's promise to him.
God forbade him from building a place for the ark of God, but David did not simply rest and take it easy. Chapters 22-28 of 1 Chronicles are an account of the preparations David made for the building of the temple. He gathered the materials, ordered the divisions of the Levites, the priests, the musicians, the gatekeepers, and the treasuries. He gave specific instructions to his son, Solomon, and charged him to build the temple. He set everything in place for the construction of the temple and he did it with all his might.
David was not allowed by God to build the house of his God; however, he continued with all his might to make preparations so that someone else could. To what work has God closed the door to you that you have simply ignored in frustration? Is it possible that He would have you and I to continue to prepare for it with "all my might" so that someone else could complete the work? Consider that continued prayer for the work goes much farther in preparing the work for completion than the mere gathering of materials. Dedicate yourself to this even though you have been forbidden from doing the work yourself.