English 中文(简体)
如何使用VBA 64-bit发送DDE(数据交换)信息?
原标题:How to send DDE (Dynamic Data Exchange) information using VBA 64-bit?
  • 时间:2024-02-10 01:40:44
  •  标签:
  • excel
  • vba
  • dde

SumatraPDF is a light and fast PDF viewer.
One can control SumatraPDF with DDE commands.
https://www.sumatrapdfreader.org/docs/DDE-Commands.

我要利用BA控制SummatraPDF。

And here is a demo from Microsoft for DDE application.
https://learn.microsoft.com/en-us/office/vba/api/excel.application.ddeinitiate
I tested it in Excel VBA (64bit).
The error message always says Type mismatch for the line Application.DDEExecute channelNumber, "[FILEPRINT]".
I think I need to convert longPtr type channelNumber to long type.
Could you help to point it out how to do this? Thanks.

** 本文件迟交。 外交部

Sub testdde()
Dim channelNumber As LongPtr
channelNumber = Application.DDEInitiate( _
 app:="WinWord", _
 topic:="C:WINWORDFORMLETR.DOC")
Application.DDEExecute channelNumber, "[FILEPRINT]"
Application.DDETerminate channelNumber
End Sub
问题回答

请注意,我使用的是32条轨道VBA,有32条轨道SumatraPDF,但你绝不应试图跨越32/64bit安全边界。 因此,在64个轨道上,只有64个轨道上的SumatraPDF。 它应为大多数用户工作,无论是便携式还是安装。

打开档案,需要苏门答腊人民抵抗力量积极倾听。 然而,你可以指挥线发射第一号档案,然后由国防部控制。

你们需要看看一下在VBA中被带刺的报价。

Sometimes it pays to open a secondary file before close the previous one otherwise there may be a time period without either.

Sub Sumatrapdf()
 
  Sumatrapdf Macro
  testdde()
 

Dim channelNumber As Long
channelNumber = Application.DDEInitiate( _
 app:="SUMATRA", _
 topic:="control")
Application.DDEExecute channelNumber, "[Open(" & """C:	empBurj Khalifa (8).pdf""" & ", 1, 1, 0)]"
Application.DDETerminate channelNumber
End Sub

“entergraph

很多没有刺s的指挥机构,例如:

Application.DDEExecute channelNumber, "[CmdClose]" 

将关闭目前的表格。 为了提高效率,避免完全关闭,因为在完全活跃记忆之前,它无法作出反应。





相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签