没有合适的资源?快使用搜索试试~ 我知道了~
首页vb中excel文件操作函数
资源详情
资源评论
资源推荐

vb 中 xlBook.SaveAs 的问题
2011-11-22 19:05
提问者:
jjuuuiiiikkkkk |
浏览次数:
368
次
:
为什么总是提示没找到控件,怎样才能把 当做保存文件的文件名啊
我来帮他解答
您还可以输入 个字
2011-11-22 19:11
满意回答
!!
追问
为什么前面有 " 就不能保存
日期不能做文件名吗?
回答
日期里有#符号的话就不能做了,文件名里不允许有#符号,不过可以变通
!$%%%%) !
建议采纳

光标控制
光标回到某一个文本框里的函数
继续&''
'(
循环 do until …….loop 用法
DoUntilintRandomNumber=10
'Getarandomnumberbetween0and24
intRandomNumber=objRandom.Next(25)
'Addthenumbertothelist
lstData.Items.Add(intRandomNumber)
Loop

Excel VBA 在工作表(Worksheet)中动态添加按钮控件并用
VB 向 excel 里添加控件,比如按钮或者 barcodectrl
()*(
+自动添加一个 ,
+动态生成一个按钮控件
+动态生成事件
+
---".,.,
---"*%/)0120)3'
---"454
---",4
---.,.,6',
---+.,新表
---47$8
---*%/).,0120)3'%9($1&
-------$"9%:'$16416$949$., ;;7$<4,&
-------=>
---*%/)*%/(+设置按钮名
---*%/)0)3'9我的按钮+设置按钮标题
---
---,.,
---+也可以是
---+,,.).,新表
---+向新表中添加事件
---+注意:
---+、添加事情的程序名一定要与添加的按钮名称对应
---+;、如果出现不信任到 ?('@3'的程序连接的错误,解决方法为:
---+--打开 2'-》工具-》宏-》安全性-》可靠发行商,选中“信任对于 ?('项目的访问”,
按确定即可。
自己写的例子,通过编译了可以运行
@()&'
"992'99'
")2'.)
",2'.,

"430120)3'
99/2'99'
99?)(
)99.)09
,),
43 ,0120)3'%950"2$ 16>$ 9>$
.,7>$<4,7>
43)3'%8
43)3'1.4,A
43)3'16>
43)3'9>
43)3'.,A>
43)3'<4,A>
43)3'?()'6
43)3'56,
,@0($
99"9%
,"
)
)
99B(
2()
VB 设置 excel 的页面设置
Private Sub Command2_Click()
Dim xlapp As New Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet

xlapp.Caption = "test "
Set xlbook = xlapp.Workbooks.Add
Set xlsheet = xlbook.Worksheets(1)
With xlapp.ActiveSheet.PageSetup
.LeftHeader = " " 该属性返回或设置页眉中左边的内容。
.CenterHeader = " "
.RightHeader = " "
.LeftFooter = " "
.CenterFooter = " "
.RightFooter = " "
.LeftMargin =
Application.InchesToPoints(0.354330708661417) '左边距
.RightMargin =
Application.InchesToPoints(0.354330708661417) '右边距
.TopMargin =
Application.InchesToPoints(0.590551181102362) '上边距
.BottomMargin =
Application.InchesToPoints(0.590551181102362) '下边距
.HeaderMargin =
Application.InchesToPoints(0.118110236220472) '页眉
.FooterMargin =
Application.InchesToPoints(0.118110236220472) ' 页脚
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
剩余23页未读,继续阅读










安全验证
文档复制为VIP权益,开通VIP直接复制

评论2