Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共1 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]请问金字塔怎么同时开启来多Excel文件这么这样行不通

1楼
cyq220657 发表于:2015/6/5 15:48:46
这样只有开启一个Excel文件,求解决 开起多个Excel文件方法
PUBLIC ExcelApp,NowWrite(20),ExcelApp1
Sub StartExcel()
OpenExcelFile
OpenExcelFile2

End sub
Sub OpenExcelFile()
On Error Resume Next
Set ExcelApp = GetObject(,"Excel.Application")

if Err.number<>0 then
Set ExcelApp = CreateObject("Excel.Application")
'打开指定文件
Set ExcelApp = GetObject("d:\金字塔决策交易系统\orderlog\TradeLog.xls")
'打开指定文件
Set ExcelApp = ExcelApp.Workbooks("TradeLog.xls")
If Err.number<>0 then
Set ExcelApp = GetObject("d:\金字塔决策交易系统\orderlog\TradeLog.xls")
End If
end if
ExcelApp.Parent.Windows("TradeLog.xls").Activate
ExcelApp.Application.DisplayFormulaBar=False
  If ExcelApp.Application.Visible = False then
  ExcelApp.Application.Visible = True
  End if
ExcelApp.Application.DisplayAlerts=False
end sub

Sub OpenExcelFile2()
On Error Resume Next
Set ExcelApp1 = GetObject(,"Excel.Application")

if Err.number<>0 then
Set ExcelApp1 = CreateObject("Excel.Application")
'打开指定文件
Set ExcelApp1 = GetObject("d:\金字塔决策交易系统\orderlog\VirtualTradeLog.xls")
'打开指定文件
Set ExcelApp1 = ExcelApp1.Workbooks("VirtualTradeLog.xls")
If Err.number<>0 then
Set ExcelApp1 = GetObject("d:\金字塔决策交易系统\orderlog\VirtualTradeLog.xls")
End If
end if
ExcelApp1.Parent.Windows("VirtualTradeLog.xls").Activate
ExcelApp1.Application.DisplayFormulaBar=False
  If ExcelApp1.Application.Visible = False then
  ExcelApp1.Application.Visible = True
  End if
ExcelApp1.Application.DisplayAlerts=False
end sub

共1 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01367 s, 2 queries.