Less than three months ago, I recommended buying shares of office supply company Staples (SPLS), which traded at the time for around $12.80 per share. The main reason behind my recommendation was the strength of the commercial delivery segment, which I would argue is the heart of Staples' business. Since then, shares of Staples have surged, rising more than 30%.

SPLS Chart

SPLS data by YCharts

Part of this rise has been due to the relatively strong earnings Staples reported for its third quarter. The recent jump, though, is tied to the stake that Starboard Value bought in both Staples and rival Office Depot (ODP -1.24%). Starboard is pushing for a merger between the two companies, and the market has responded favorably to that idea.

After shares of Staples have surged by so much so quickly, is the stock still a buy? Or has the opportunity I pointed out in September passed?

Growing where it matters
Staples retail business is still doing poorly. In the third quarter, comparable-store sales fell by 4%, a bit better than the 5% decline during the second quarter, but still far from a desirable result. The big problem is that there are simply too many office supply stores in the United States, and both Staples and Office Depot are actively closing hundreds of stores to correct this.

Staples is not just a retailer, though. Its commercial delivery business, which is nearly as big as its North American retail business, has been growing, and during the third quarter this growth accelerated. Sales rose by 3.3%, driven by mainly the expansion of products beyond core office supplies. About 40% of Staples commercial sales are now in categories beyond office supplies, and the company's plan to become a one-stop shop for everything a business needs appears to be working.

Online sales are growing as well, with sales through Staples.com rising by 9% year over year during the third quarter. The parts of the business that will be more important in the future as Staples downsizes its retail operations are growing nicely, and the retail stores are still generating profits, with a segment operating margin of 7.7% during the third quarter. Staples' business has proven to be quite resilient in the face of weak demand for office supplies, and the company is taking the necessary steps to remain successful in the future.

The price is no longer right
Despite the strength of Staples' business, the stock price is no longer very attractive. I own shares of Staples, but I won't be buying anymore at this price, and I may be selling my stake soon if the stock keeps surging. Staples now trades around $17 per share, which is a little over 17 times trailing-12-month earnings. These earnings are depressed from peak levels in 2011, where Staples earned $1.40 per share, and using this number the P/E ratio is a more reasonable 12. But getting earnings back to that level is going to take time, especially with sales in the stores still declining, so it makes little sense to use that number.

It may be tempting to buy Staples stock in the hope that Starboard can bring about a merger with Office Depot, but buying a stock solely because of the possibly of an acquisition or merger is rarely a good idea. It's unclear whether regulators would even allow such a merger to take place; there's plenty of competition on the retail side of things, but the commercial side is a different story.

I think that most of the opportunity in Staples has passed. Now, merger speculation can certainly lead the stock to do silly things, and it could very well rise significantly from here. But that's not a reason that should sway long-term investors. If shares of Staples ever fall back around $11 per share, which is the average price I paid, I'll be buying hand over fist. But at $17 per share, I'll pass on buying more.