This paper discusses key challenges and opportunities that arise when using linked electronic health records (EHR) in health economics and outcomes research (HEOR), with a particular focus on estimating healthcare costs. These challenges and opportunities are framed in the context of a case study modelling the costs of stable coronary artery disease in England. The challenges and opportunities discussed fall broadly into the categories of (1) handling and organising data of this size and sensitivity; (2) extracting clinical endpoints from datasets that have not been designed and collected with such endpoints in mind; and (3) the principles and practice of costing resource use from routinely collected data. We find that there are a number of new challenges and opportunities that arise when working with EHR compared with more traditional sources of data for HEOR. These call for greater clinician involvement and intelligent use of sensitivity analysis.