ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 1412|回复: 0

[求助] 一个调用dll 的vba 在Excel 里可以 access 里缺不能用求老师解答

[复制链接]

TA的精华主题

TA的得分主题

发表于 2014-10-17 20:03 | 显示全部楼层 |阅读模式
先上图吧!
2.jpg

我自己用access 弄了个管理软件,满足自己日常工作需要,现在想要实现控件打印的功能,官方网站提供了VBA调用dll的范例,有Excel 的和access的,Excel的范例和access的范例模组都是一样的,可现在Excel 可以正常调用,access 就报上图的提示,现在不知道要如何解决,估计官方的案例只是在Excel 里进行了测试没有在access里进行测试!
  1. Option Compare DatabasePublic Declare Sub openport Lib "TSCLIB.DLL" (ByVal PrinterName As String)
  2. Public Declare Sub closeport Lib "TSCLIB.DLL" ()
  3. Public Declare Sub sendcommand Lib "TSCLIB.DLL" (ByVal command As String)
  4. Public Declare Sub setup Lib "TSCLIB.DLL" ( _
  5.         ByVal LabelWidth As String, _
  6.         ByVal LabelHeight As String, _
  7.         ByVal Speed As String, _
  8.         ByVal Density As String, _
  9.         ByVal Sensor As String, _
  10.         ByVal Vertical As String, _
  11.         ByVal Offset As String)
  12. Public Declare Sub downloadpcx Lib "TSCLIB.DLL" ( _
  13.         ByVal Filename As String, _
  14.         ByVal ImageName As String)
  15. Public Declare Sub barcode Lib "TSCLIB.DLL" ( _
  16.         ByVal X As String, _
  17.     ByVal Y As String, _
  18.     ByVal CodeType As String, _
  19.     ByVal Height As String, _
  20.     ByVal Readable As String, _
  21.     ByVal rotation As String, _
  22.     ByVal Narrow As String, _
  23.     ByVal Wide As String, _
  24.     ByVal Code As String)
  25. Public Declare Sub printerfont Lib "TSCLIB.DLL" ( _
  26.     ByVal X As String, _
  27.     ByVal Y As String, _
  28.     ByVal FontName As String, _
  29.     ByVal rotation As String, _
  30.     ByVal Xmul As String, _
  31.     ByVal Ymul As String, _
  32.     ByVal Content As String)
  33. Public Declare Sub clearbuffer Lib "TSCLIB.DLL" ()
  34. Public Declare Sub printlabel Lib "TSCLIB.DLL" ( _
  35.     ByVal NumberOfSet As String, _
  36.     ByVal NumberOfCopy As String)
  37. Public Declare Sub formfeed Lib "TSCLIB.DLL" ()
  38. Public Declare Sub nobackfeed Lib "TSCLIB.DLL" ()
  39. Public Declare Sub windowsfont Lib "TSCLIB.DLL" ( _
  40.     ByVal X As Integer, _
  41.     ByVal Y As Integer, _
  42.     ByVal fontheight As Integer, _
  43.     ByVal rotation As Integer, _
  44.     ByVal fontstyle As Integer, _
  45.     ByVal fontunderline As Integer, _
  46.     ByVal FaceName As String, _
  47.     ByVal TextContent As String)Public Declare Sub windowsfontU Lib "TSCLIB.DLL" ( _
  48.     ByVal X As Integer, _
  49.     ByVal Y As Integer, _
  50.     ByVal fontheight As Integer, _
  51.     ByVal rotation As Integer, _
  52.     ByVal fontstyle As Integer, _
  53.     ByVal fontunderline As Integer, _
  54.     ByVal FaceName As String, _
  55.     ByVal TextContent As String)Public Declare Sub about Lib "TSCLIB.DLL" ()Public Declare Function isusbportready Lib "TSCLIB.DLL" () As Integer
  56. Public Declare Function usbportqueryprinter Lib "TSCLIB.DLL" () As Integer
  57. Public Declare Function usbportwrite Lib "TSCLIB.DLL" (ByVal command As String) As Integer
  58.   
复制代码
模组的内容如上图,求老师帮忙看看是不是哪里有错误,造成access 无法执行!

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-11-17 07:53 , Processed in 0.039301 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表