在线等待:VBA中调用过程时出现编译错误,帮忙指点一下(初次使用VBA)
八月 3, 2007
发表在: java
sub createfunction(byval spath as string, verflag as string)
dim iloop as integer
set fs = createobject("scripting.filesystemobject")
sfilename = spath & "\function.sql"
set fhandle = fs.createtextfile(sfilename, true)
for iloop = 2 to sheets("集中交易功能号&菜单号").usedrange.rows.count
if trim(sheets("集中交易功能号&菜单号").cells(iloop, 7)) <> "" then
if verflag = "0" or trim(sheets("集中交易功能号&菜单号").cells(iloop, 13)) = verflag then
sprompt = "insert into ks.ksfunction(function_no,function_name,right_level," & _
"function_set_index,grant_auth_flag,man_auth_flag,note,set_emp,set_date,set_time) values ( " & _
trim(sheets("集中交易功能号&菜单号").cells(iloop, 7)) & ", " & _
trim(sheets("集中交易功能号&菜单号").cells(iloop, 8)) & ", " & _
trim(sheets("集中交易功能号&菜单号").cells(iloop, 9)) & ", " & _
trim(sheets("集中交易功能号&菜单号").cells(iloop, 10)) & ", " & _
trim(sheets("集中交易功能号&菜单号").cells(iloop, 11)) & ", " & _
trim(sheets("集中交易功能号&菜单号").cells(iloop, 12)) & ", " & _
trim(sheets("集中交易功能号&菜单号").cells(iloop, 14)) & ", , , "
fhandle.writeline (sprompt)
end if
end if
next
fhandle.writeline ("go")
fhandle.close
end sub
private sub cbstandard_click()
createfunction(tbfilename.text,"1")
end sub
调用createfunction出现编译错误,“缺少:=”
电脑软件技术推荐:
call createfunction(tbfilename.text, "1") 这句加个“call”或去掉括号
同意楼上
call createfunction(tbfilename.text,"1")
函数调用不对
No comments in this entry