以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  转PDF问题盼高手指教。  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=47211)

--  作者:ndxfke
--  发布时间:2014/3/6 13:24:00
--  转PDF问题盼高手指教。
方式一 引用贴子:4楼
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=28786


方式二 引用贴子:5楼
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=29432&skin=0

例子如下 测试窗体名:转PDF测试
 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:转pdf测试.foxdb



报错:

.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2014.3.7.1
错误所在事件:窗口,PDF测试,Button1,Click
详细错误信息:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

--  作者:ybil
--  发布时间:2014/3/6 14:22:00
--  
试了可行

Dim flt1,flt2 As String
flt1 = "D:\\Book.xls"
flt2 = "D:\\Test.PDF"

If Not FileSys.FileExists(flt1) Then
    Messagebox.Show("文件不存在或已经被删除!","提示")
    Return False
End If

Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(flt1)
wb.ExportAsFixedFormat(MSExcel.XlFixedFormatType.xlTypePDF, flt2)
App.Quit


--  作者:ndxfke
--  发布时间:2014/3/6 14:52:00
--  
感谢 ybil 出手帮忙!

我也用了你的代码,测试还是报这个错。

这是个什么情况呢?还有没有谁遇到过呢。图片点击可在新窗口打开查看

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


--  作者:Bin
--  发布时间:2014/3/6 14:53:00
--  
收保护的内存, 是不是文件没有权限访问.
--  作者:ndxfke
--  发布时间:2014/3/6 15:06:00
--  
文件位于D盘,也没做过权限设置, 应该不能啊。

如何解决,支支招儿啊。