カレントディレクトリのファイル名からフルパス名を求める(Windows)

HaskellExcel を操作するためにまずはファイル名からフルパス名を求めます。

import System.Win32.Com 
import System.Win32.Com.Automation 
import Debug.Trace

getFullPathName :: String -> IO String
getFullPathName fname = do
    createObject "Scripting.FileSystemObject" >>= getAbsolutePathName >>= return
        where
            getAbsolutePathName str = method1 "GetAbsolutePathName" [inString fname] outString str

doAutomation :: IO ()
doAutomation  = coRun $ getFullPathName "sample2.xls" >>= print
Prelude> :load "excel.hs"
[1 of 1] Compiling Main             ( excel.hs, interpreted )
Ok, modules loaded: Main.
Main> doAutomation
"D:\\lang\\COM\\Excel\\sample2.xls"

Excel ファイルのオープンで苦戦・・・。