ivankokan / Excel2LaTeX

The Excel add-in for creating LaTeX tables
Other
1.27k stars 147 forks source link

Excel2010 variable #7

Closed krlmlr closed 8 years ago

krlmlr commented 8 years ago

To me, it looks like the only API difference between Excel >= 2010 and < 2010 is the DisplayFormat property, which must be used only for >= 2010. How about:

Function DisplayFormat(ByVal cell As Cell) As Object
    If Excel2010 Then
        Set DisplayFormat = cell.DisplayFormat
    Else
        Set DisplayFormat = cell
    End If
End Function

For better IntelliSense, perhaps we'd also want to wrap the properties we're accessing. Or use a full-blown interface with two implementations.

Would the preprocessor work, too? http://stackoverflow.com/q/6325486/946850

chelh commented 8 years ago

Done

krlmlr commented 8 years ago

LGTM