Add(MainForm,4378171,203,84)
{
Width=626
Height=643
}
Add(ChildPanel,6304782,371,140)
{
@Hint=#5:Прайс|
}
BEGIN_SDK
Add(EditMulti,13873045,21,21)
{
EventCount=2
WorkCount=1
Width=860
Height=655
link(doWork1,11410566:doEvent1,[(45,27)(45,202)])
}
Add(Panel,14000364,63,28)
{
Left=625
Top=15
Width=214
Height=144
Visible=1
Layout="parent.vert"
}
Add(FormatStr,15762674,315,119)
{
Mask="Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};\r\nDriverID=22;\r\nDBQ=%1;\r\nDefaultDir=%2;\r\nFirstRowWhasNames=1;\r\nReadOnly=true;\r\nScanRows=0;"
Point(FString)
link(Str2,16353759:Var2,[])
}
Add(OLEdb,3042347,175,280)
{
Point(onError)
link(onConnect,15799951:doCreate,[])
link(Driver,15762674:FString,[(181,186)(321,186)])
link(onError,6281013:doMessage,[(219,293)(219,314)(163,314)(163,335)])
}
Add(OLEdb_Session,15799951,238,280)
{
Point(onError)
link(onError,3395621:doMessage,[(278,293)(278,307)])
}
Add(FormatStr,5978579,427,287)
{
Mask="SELECT * FROM "%2"."%1$A4:D" "%1$";"
link(onFString,6949883:doQuery,[(471,293)(471,342)(226,342)(226,391)])
link(Str1,4870236:String,[])
link(Str2,16353759:Var3,[(440,103)])
}
Add(VBJScript,345803,315,210)
{
@Hint=#16:Query SQL Server|
WorkPoints=#6:doOpen|7:doSheet|7:doClose|
EventPoints=#8:onSheets|6:onOpen|
Script=#9:Dim strIn|5:Dim i|5:Dim j|12:Dim objExcel|11:Dim onExcel|0:|22:Sub doWork(Data,Index)|18: Select Case Index|15: Case "doOpen"|52: Set objExcel = CreateObject("Excel.Application")|52: Set objWorkbook = objExcel.Workbooks.Open (Data)|71: j = objWorkbook.Sheets.Count 'Узнаём количество листов|88: For i=1 To j 'Листы начинаются не с "0", а с "1" |86: strIn = objWorkbook.Sheets(i).Name 'Узнаём имя очередного листа |65: sys.onSheets strIn 'Выводим имя наружу|9: Next|17: sys.onOpen 1 |94: 'Case "doSheet" 'На вход подаётся строка, содержащая имя Листа|33: 'objExcel.Sheets(Data).Select|38: 'objExcel.ActiveSheet.Cells.Select|43: 'objExcel.Selection.NumberFormat = "@" |39: 'objExcel.ActiveWorkbook.Save() |17: Case "doClose"|17: objExcel.Quit|26: Set objExcel = Nothing|17: sys.onOpen 0 |0:|11: End Select|0:|7:End Sub|
UseName=0
link(onSheets,4870236:doAdd,[])
}
Add(Hub,45852,280,203)
{
OutCount=4
link(onEvent1,15762674:doString,[(304,209)(304,125)])
link(onEvent2,345803:doOpen,[])
link(onEvent3,345803:doClose,[(304,223)(304,230)])
link(onEvent4,7883240:doText,[(301,230)(301,244)])
}
Add(Hub,11410566,70,196)
{
OutCount=4
link(onEvent1,2139596:doValue,[(203,202)(203,62)])
link(onEvent2,45852:doEvent1,[])
link(onEvent3,3042347:doOpen,[(130,216)(130,286)])
link(onEvent4,5978579:doString,[(270,223)(270,244)(284,244)(284,293)])
}
Add(OLEdb_Query,6949883,238,385)
{
link(onQuery,9619184:doEvent1,[])
link(onColumns,9619184:doEvent2,[])
link(onError,11907218:doMessage,[(296,405)(296,440)])
link(dbSession,15799951:dbSession,[])
}
Add(GetDataEx,16353759,322,98)
{
link(Data,2139596:Value,[])
}
Add(StrList,4870236,406,210)
{
Point(String)
Point(doGetString)
}
Add(VisualStrings,7883240,364,238)
{
Lines=#1:0|
Width=18
Point(doText)
Point(onText)
link(onText,4870236:doGetString,[])
}
Add(Message,11907218,322,434)
{
Caption="3"
Icon=1
}
Add(Message,6281013,175,329)
{
Caption="1"
Icon=1
}
Add(Message,3395621,287,301)
{
Caption="2"
Icon=1
}
Add(Memory,2139596,322,56)
{
}
Add(MT_String,3709045,322,385)
{
link(onResult,13873045:onEvent1,[(618,391)(618,27)])
}
Add(Hub,9619184,287,385)
{
InCount=2
OutCount=1
link(onEvent1,3709045:doStr,[])
}
END_SDK
Add(Button,4982637,259,84)
{
Left=5
Top=5
Caption=" Open"
link(onClick,10622552:doExecute,[])
}
Add(ODialog,10622552,308,84)
{
link(onExecute,5432892:doWork,[])
}
Add(Memo,8268735,434,84)
{
Left=10
Top=35
Width=590
Height=565
ScrollBars=3
}
Add(VBJScript,5432892,371,84)
{
@Hint=#16:Query SQL Server|
WorkPoints=#6:doWork|
EventPoints=#6:onRead|7:onClear|
Script=#26:Dim strOut, intRow, intCol|0:|22:Sub doWork(Data,Index)|52: Set objExcel = CreateObject("Excel.Application")|52: Set objWorkbook = objExcel.Workbooks.Open (Data)|19: sys.onClear nil|4: |36: ' objExcel.Sheets("Лист1").Select|7: |55: intRow = 2 ' № строки с которой начнётся считывание|14: intCol = 1|4: |59: Do While Not IsEmpty(objExcel.Cells(intRow,1).Value) |69: Do While Not IsEmpty(objExcel.Cells(intRow,intCol).Value) |69: strOut = strOut & objExcel.Cells(intRow, intCol).Value & ";" |27: intCol = intCol + 1|14: Loop |25: sys.onRead strOut|14: strOut = "" |18: intCol = 1|27: intRow = intRow + 1|8: Loop|4: |17: objExcel.Quit|0:|7:End Sub|
UseName=0
link(onRead,8268735:doAdd,[])
link(onClear,8268735:doClear,[])
}
Ответов: 783
Рейтинг: 168
|
|||
Sersey, попробуй использовать только VBJScript.
|
|||
карма: 15 |
|
Редактировалось 3 раз(а), последний 2020-08-30 13:50:53