日期:2014-05-19  浏览次数:20768 次

JACOB操作word 报错 VariantChangeType failed
问题如题,哪位同仁有解决办法,求赐教,感激不尽!我的分不多,真的不好意思,很急的问题
com.jacob.com.ComFailException: VariantChangeType failed
at com.jacob.com.Variant.toDispatch(Native Method)
at com.augurit.gzcgZF.app.zhzf.util.FileDemoUtil.buildWordFileByTemplate(FileDemoUtil.java:298)
at com.augurit.gzcgZF.app.zhzf.service.impl.BookListServiceImpl.createBookDocByType(BookListServiceImpl.java:505)
at com.augurit.gzcgZF.app.zhzf.service.impl.BookListServiceImpl.createBookDoc(BookListServiceImpl.java:385)
at sun.reflect.GeneratedMethodAccessor831.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy56.createBookDoc(Unknown Source)
at com.augurit.gzcgZF.app.zhzf.web.CaseArchiveidAction.createDoc(CaseArchiveidAction.java:225)
at com.augurit.gzcgZF.app.zhzf.web.CaseArchiveidAction.downloadZip(CaseArchiveidAction.java:269)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

------解决方案--------------------
亲,我也遇到一样的问题了,还是没找到解决方法。
好像沉了
------解决方案--------------------
http://blog.csdn.net/zcmssd/article/details/7443502
Windows 2008 Server x64

Please make this folder.

C:\Windows\SysWOW64\config\systemprofile\Desktop

?Windows 2008 Server x86

Please make this folder.

C:\Windows\System32\config\systemprofile\Desktop

------解决方案--------------------
楼主的jacob操作的word的版本是多少 03,07,10,以及12版本的word的操作是不一样的

楼主的错误可能是word文档版本不匹配