Replacing VBA in Excel with Python