| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 354 人关注过本帖
标题:Me.为无效关键字,是要换成相应的坐标行吗?
只看楼主 加入收藏
学习要努力
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2013-11-26
结帖率:0
收藏
 问题点数:0 回复次数:2 
Me.为无效关键字,是要换成相应的坐标行吗?
画折线图                                
Option Explicit                                
Dim Appxls As New Application                                
Dim WorkBook As WorkBook                                
Dim AppSheet As Worksheet                                
Dim PathName As String                                

Private Sub Command1_Click()                                
Dim i As Integer                                
Randomize                                
= "*.xls|*.xls "                                
                                
PathName =                                 
Set WorkBook = Appxls.Workbooks.Open(PathName)                                
Set AppSheet = WorkBook.Worksheets( "sheet1 ")                                
For i = 1 To 4                                
AppSheet.Cells(i, "A ") = CInt(Rnd * 200)                                
Next                                
For i = 1 To 4                                
AppSheet.Cells(i, "B ") = CInt(Rnd * 100)                                
Next                                
For i = 1 To 4                                
AppSheet.Cells(i, "C ") = CInt(Rnd * 100)                                
Next                                
Dim x As Chart 'Create an embedded chart on a chart sheet.                                
Set x = Charts.Add                                
x.ChartType = xlLine                                
x.SetSourceData Source:=Sheets( "Sheet1 ").Range( "A1:C4 "), PlotBy:=xlColumns                                
Set x = x.Location(Where:=xlLocationAsObject, Name:= "Sheet1 ")                                
' Move chart to new sheet and reset the chart object variable x.                                
' Set x = x.Location(Where:=xlLocationAsNewSheet, Name:= "Chart1 ")                                
' Move chart to back to the chart sheet.                                
End Sub                                
Private Sub Form_Load()                                
Me.Show                                
Set Appxls = Excel.Application                                

End Sub                                

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)                                
WorkBook.Save 'save file(*.xls)                                

AppSheet.Application.Quit 'close EXCEL.EXE in Windows                                

Set AppSheet = Nothing                                
Set WorkBook = Nothing                                

'Appxls.Quit                                

Set Appxls = Nothing                                
End Sub                                
搜索更多相关主题的帖子: 关键字 
2013-11-26 10:06
风吹过b
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:364
帖 子:4947
专家分:30084
注 册:2008-10-15
收藏
得分:0 
哪一行报 无效关键字????

人脑不是电脑,无法一眼就看出错误在那里。

授人于鱼,不如授人于渔
早已停用QQ了
2013-11-26 17:28
学习要努力
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2013-11-26
收藏
得分:0 
= "*.xls|*.xls "                                
                                 
2013-11-27 09:50
快速回复:Me.为无效关键字,是要换成相应的坐标行吗?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030601 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved