【发布时间】:2020-03-06 22:19:22
【问题描述】:
我有一个 VB6 EXE 程序从 VBA 中传递的字符串中获取子字符串。 如何在 VBA 中捕获 extract 的值 (我对 VBA Mid 函数不感兴趣)
在 VB6 中
Private Sub Main()
Extract (command$)
End Sub
Function Extract(StrKey As String)
LastPoss = InStr(StrKey, "_") + 1
Extract = Mid(StrKey, LastPoss, Len(StrKey))
End Function
在 VBA 中
Sub test()
aaa = "c:\EzPasteImages\Project1.exe "**strong text**
ccc = "ghhfghfgh_hgfhg" 'the parameter
go = aaa & " " & ccc
RET= Shell (go)
End Sub
【问题讨论】:
-
您了解 VB6(编译器和表单包)承载 VBA 语言。所以
Mid完全一样。