That statement is at the conclusion of a lengthy discussion of gifts of the spirit (ch. 12-14, cf. the similar phraseology in the concluding statement in 11:16) and in context Paul is appealing to those who claim to have spiritual gifts to recognize the "command of the Lord" (kuriou entolé) in what he wrote. This is parallel to the other times when Paul declared that his apostolic exhortations are authorized by the Lord or represent a dominical command (cf. 1 Corinthians 7:10-11 [= Mark 10:11-12], 9:14 [= Luke 10:7], 11:23-26 [= Mark 14:22-25], etc.), and Paul (just as in the LXX) uses entolé in the singular to refer to the individual commandments of the Law or the specific teachings of Jesus (cf. Romans 13:9, 1 Corinthians 7:10, Galatians 5:14, etc.), not his own directions per se. Paul is thus probably alluding to the same "commandment" (entolé) he quoted in Romans 13:8-10 and Galatians 5:13-14 (= Matthew 22:39-40), i.e. the command of reciprocal love (cf. also the golden rule in Matthew 7:12, which "sums up the Law and the Prophets", which agrees with what Paul says in Galatians 5:13-14 about the command to love "fulfilling the entire Law"). This is the theme especially of ch. 13 which exhorts those with spiritual gifts to display mutual love, and this theme continues in 14:1, 3, 12, 26, 33. The reference to the dominical command in v. 37 establishes that all this follows from what is commanded by the Lord. So we find the same evaluation of people with spiritual gifts who do not abide by God's will in Matthew 7:21-23 (with the Law summed up in v. 12 by the golden rule). The connection with Matthew 7:21-23 is especially prescient because Jesus warns that such people with spiritual gifts will be ignored in judgment ("I never knew you, away from me you evildoers") which matches Paul's warning in 1 Corinthians 14:38 about those who ignore the Lord's command ("They will themselves be ignored").
Even though Paul generally claims to speak "in Christ" (cf. 2 Corinthians 2:17, 12:19) and that Christ speaks through him (2 Corinthians 13:3), he makes a clear distinction between what is said "by the Lord" and what a person says "in the Lord", as seen in his opinions being distinguished from what the Lord says, e.g. 1 Corinthians 4:9 ("it seems to me"), 7:10, 12 ("I say, not the Lord"), 7:25 ("I have no charge from the Lord but I give my own opinion"), 7:40 ("in my judgment"), 2 Corinthians 8:10 ("here is my judgment on this matter"), 11:17, 21 ("speaking not as the Lord would but as a fool"), etc. It is thus unwarranted to think that Paul regarded his own epistle (containing many of his own opinions being distinguished from what the Lord says) to be itself a "command" given by the Lord (as opposed to referencing and containing commands of the Lord alongside his own opinion). And even if he did, it is a further leap to conclude that this means that Paul believed that his own epistles should be classed on par with the books of the OT as sacred scripture.