testMSOffice.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:mac-package-build 作者: persepolisdm 项目源码 文件源码
def TestAll():
    try:
        TestWord()

        print("Starting Excel for Dynamic test...")
        xl = win32com.client.dynamic.Dispatch("Excel.Application")
        TextExcel(xl)

        try:
            print("Starting Excel 8 for generated excel8.py test...")
            try:
                mod = gencache.EnsureModule("{00020813-0000-0000-C000-000000000046}", 0, 1, 2, bForDemand=1)
            except TypeError:
                mod = gencache.EnsureModule("{00020813-0000-0000-C000-000000000046}", 0, 1, 2)
            xl = win32com.client.Dispatch("Excel.Application")
            TextExcel(xl)
        except ImportError:
            print("Could not import the generated Excel 97 wrapper")

        try:
            import xl5en32
            mod = gencache.EnsureModule("{00020813-0000-0000-C000-000000000046}", 9, 1, 0)
            xl = win32com.client.Dispatch("Excel.Application.5")
            print("Starting Excel 95 for makepy test...")
            TextExcel(xl)
        except ImportError:
            print("Could not import the generated Excel 95 wrapper")

    except KeyboardInterrupt:
        print("*** Interrupted MSOffice test ***")
    except:
        traceback.print_exc()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号