小编Kra*_*atz的帖子

VB中可变数量的参数

如何在visual basic中创建具有可变数量参数的函数?恩.

x =  Sum(1,2,3)
y =  Sum(1,2)

Function Sum('how to declare argument here')
'Is there any special argument manipulation inside function before it is usable?
End Function
Run Code Online (Sandbox Code Playgroud)

vb6

22
推荐指数
2
解决办法
1万
查看次数

如何在Excel VBA中获取给定模块名称的Function和Sub列表

我正在研究一个辅助宏,它调查活动excel工作簿上给定模块名称的list函数.例如:我有一个模块名称"Module1".该模块内部具有以下功能或子功能

Sub Sub1()
End Sub

Sub Sub2()
End Sub

Function Func1()
End Function

Function Func2()
End Function
Run Code Online (Sandbox Code Playgroud)

是否有可以返回函数和子名称列表的命令或例程?

excel vba excel-vba

10
推荐指数
1
解决办法
1万
查看次数

使用VB/VBA中的"CallByName"调用模块中包含的Sub或Function

使用CallByName调用classModule中的函数很容易.标准模块中的函数怎么样?

''#inside class module
''#classModule name: clsExample
  Function classFunc1()
     MsgBox "I'm class module 1"
  End Function
''# 
''#inside standard module
''#Module name: module1
  Function Func1()
     MsgBox "I'm standard module 1"
  End Function
''#
''# The main sub
Sub Main()
''# to call function inside class module
dim clsObj as New clsExample
Call CallByName(clsObj,"ClassFunc1")

''# here's the question... how to call a function inside a standard module
''# how to declare the object "stdObj" in reference to module1?
Call CallByName(stdObj,"Func1") ''# …
Run Code Online (Sandbox Code Playgroud)

vba

9
推荐指数
2
解决办法
6万
查看次数

Joomla:如何更改特定文章的模板

有没有办法只更改特定文章的模板?请注意,它应该无需将文章链接到任何菜单.

joomla joomla-template

9
推荐指数
1
解决办法
2万
查看次数

我可以在VB中使用"Stop"作为子程序名吗?

我想创建一个对象...说一个"电影"对象.该对象应该有一个方法名称"停止",所以我可以在下面有这个代码

dim Mov as new Movie
Mov.Stop ' To execute the Stop method.
Run Code Online (Sandbox Code Playgroud)

在我的电影课上,我应该有这样的东西.

Sub Stop()
'code here needed for the Stop subroutine
End Sub
Run Code Online (Sandbox Code Playgroud)

但是,我不能使用"停止"作为名称,因为这是一个保留字.我看到一个VB代码,其中"Stop"作为方法之一.不幸的是,代码受到保护,所以我无法查看它.

如何将子程序命名为"停止"?

vb6

5
推荐指数
1
解决办法
824
查看次数

如何在VB中调用函数名称引用字符串值的函数

我有这个算法,我想在VB6上实现.

Sub Main()
dim stringVal1 as string, stringVal2 as string
dim getOne as boolean

stringVal1 = "FunctOne"
stringVal2 = "FunctTwo"

if getOne then
    'Call Function with function name assigned to stringVal1 ... how to call the function here?**
else
    'Call Function with function name assigned to stringVal1 ... how to call the function here?**
end if

End Sub


Function FunctOne()
   Msgbox "I'm function one"
End Function

Function FunctTwo()
   Msgbox "I'm function two"
End Function
Run Code Online (Sandbox Code Playgroud)

这可以在VB6中完成吗?

vb6

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

vb6 ×3

vba ×2

excel ×1

excel-vba ×1

joomla ×1

joomla-template ×1