Power-to-Methanol is a newly emerging technology to decarbonize hard-to-abate sectors. However, little research on its flexible and optimal operation has been proposed. In this paper, a grid-connected Power-to Methanol system is introduced, modelled, simulated and optimized for its daily operation by considering its participation in day-ahead electricity markets. The system builds on a real-life application in Denmark. We first predict the electricity prices and then strategically schedule the involved components taking advantage of the potential flexibilities. The uncertainty of electricity price prediction is handled by introducing a Wasserstein metric-based data-driven robust optimization. We further compare the proposed approach with widely used stochastic and robust optimization. The results show that, for the selected case, the proposed data-driven method could reduce the operational cost by 4.5% compared to the imperfect prediction, and it moderately outperforms stochastic and robust optimization. Using the optimal operation strategy, we find that the levelized cost of methanol ranges from 584 to 1146€/t. Both CO2 price and the renewable electricity proportion significantly affect the cost.