Что то е вышло у меня посмотри если не сложно в чем ошибка. вот еще сделал по другому немного
Add(MainForm,16078593,490,49)
{
Left=20
Top=105
Width=897
Height=409
Caption="Excel"
}
Add(ODialog,16073511,539,91)
{
Filter="*.xls|*.xls|All|*.*"
link(onExecute,5432892:doOpen,[])
}
Add(VBJScript,5432892,602,91)
{
@Hint=#16:Query SQL Server|
WorkPoints=#6:doOpen|7:doWrite|7:doPrint|7:doClose|
EventPoints=#6:onRead|6:onOpen|
Script=#9:Dim strIn|10:Dim NumRow|10:Dim NumCol|5:Dim i|5:Dim j|12:Dim objExcel|0:|22:Sub doWork(Data,Index)|18: Select Case Index|17: Case "doOpen" |52: Set objExcel = CreateObject("Excel.Application")|52: Set objWorkbook = objExcel.Workbooks.Open (Data)|17: sys.onOpen 1 |16: Case "doWrite"|22: strIn = CStr(Data)|28: i = InStr(1,strIn,";",0)|37: NumRow = CLng(Mid(strIn, 1, i-1))|30: j = InStr(i+1,strIn,";",0)|41: NumCol = CLng(Mid(strIn, i+1, j-i-1))|28: strIn = Mid(strIn, j+1)|60: objExcel.ActiveSheet.Cells(NumRow, NumCol).Value = strIn|20: sys.onRead strIn|17: Case "doPrint"|38: objExcel.Application.Run (Data) |17: Case "doClose"|17: objExcel.Quit|26: Set objExcel = Nothing|20: sys.onOpen 0 |11: End Select|0:|7:End Sub|
UseName=0
link(onRead,1487283:doAdd,[(639,97)(639,48)])
link(onOpen,11205756:doEvent,[])
}
Add(Button,11007171,490,91)
{
Left=10
Top=5
Width=65
Caption="Открыть"
link(onClick,16073511:doExecute,[])
}
Add(Button,4485138,490,210)
{
Left=10
Top=190
Width=65
Enabled=1
Caption="Печать"
Point(doEnabled)
link(onClick,4525641:doData,[])
}
Add(Button,10538399,490,308)
{
Left=10
Top=160
Width=105
Enabled=1
Caption="Записать в Excel"
Point(doEnabled)
link(onClick,8742374:doEnum,[])
}
Add(Button,11387806,490,126)
{
Left=10
Top=35
Width=65
Caption="Закрыть"
link(onClick,5432892:doClose,[(578,132)(578,118)])
}
Add(LED,3276760,693,91)
{
Left=95
Top=20
}
Add(IndexToChanel,11205756,651,98)
{
link(onEvent1,3276760:doOff,[])
link(onEvent2,3276760:doOn,[])
}
Add(Edit,10160456,539,168)
{
Left=5
Top=235
Width=125
Text="PrintDoc"
}
Add(Label,732456,539,133)
{
Left=5
Top=215
Width=132
Height=17
Caption="Имя Макроса для печати"
}
Add(DoData,4525641,539,210)
{
link(onEventData,5432892:doPrint,[(583,216)(583,111)])
link(Data,10160456:Text,[])
}
Add(StringTable,9992815,539,252)
{
Left=160
Top=27
Width=355
Height=100
Columns=#8:№ стр=50|8:№ кол=50|4:№=85|15:Наименование=50|6:Ед.=50|9:Кол-во=50|7:Цена=50|13:Стоимость=50 |0:|0:|0:|3: |
Grid=0
Redaction=1
Point(Strings)
}
Add(ArrayEnum,8742374,553,308)
{
link(onItem,5432892:doWrite,[(593,314)(593,104)])
link(onEndEnum,6536108:doWork2,[(597,321)(597,205)(438,205)(438,223)])
link(Array,9992815:Strings,[])
}
Add(Button,851612,308,294)
{
Left=10
Top=115
Width=95
Caption="Очистить всё"
link(onClick,6343424:doEvent1,[])
}
Add(Hub,5077774,455,140)
{
OutCount=4
link(onEvent1,6362060:doText2,[(481,146)(481,150)(387,150)(387,153)])
link(onEvent2,16774232:doEvent1,[(481,153)(481,202)(114,202)(114,251)])
link(onEvent3,11184496:doString,[(481,160)(481,209)(394,209)(394,258)])
link(onEvent4,14369698:doWork2,[(481,167)(481,244)(394,244)(394,321)])
}
Add(Edit,13091107,154,231)
{
Left=10
Top=267
Text="1"
DataType=2
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,13025562:doEvent1,[])
}
Add(Edit,9137772,231,231)
{
Left=65
Top=267
Text="1"
DataType=2
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,171812:doEvent1,[])
}
Add(Edit,15301710,308,231)
{
Left=120
Top=267
Width=245
Text="Данные для записи"
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,602910:doEvent1,[])
}
Add(Edit,8514301,406,350)
{
Left=105
Top=85
Text="0"
DataType=2
}
Add(Button,11399868,308,392)
{
Left=10
Top=85
Width=95
Caption="Удалить строку"
link(onClick,15645264:doData,[])
}
Add(Hub,13025562,196,238)
{
OutCount=3
link(onEvent1,3685851:doWork2,[(222,244)(222,223)])
link(onEvent2,9137772:doSetFocus,[])
link(onEvent3,9137772:doSelectAll,[])
}
Add(Hub,171812,273,238)
{
OutCount=3
link(onEvent1,9137772:doText2,[(293,244)(293,223)(223,223)(223,244)])
link(onEvent2,15301710:doSetFocus,[])
link(onEvent3,15301710:doSelectAll,[])
}
Add(Hub,16774232,126,245)
{
link(onEvent1,13091107:doSetFocus,[])
link(onEvent2,13091107:doSelectAll,[])
}
Add(FormatStr,11184496,406,252)
{
DataCount=10
Mask="%1;%2;%3;%4;%5;%6"
link(onFString,9992815:doAdd,[])
link(Str1,13091107:Text,[(412,243)(401,243)(401,285)(160,285)])
link(Str2,9137772:Text,[(419,240)(396,240)(396,279)(237,279)])
link(Str3,15301710:Text,[(426,240)(370,240)(370,275)(314,275)])
link(Str4,3417919:Text,[(89,212)(89,232)(48,232)])
link(Str5,1643601:Text,[(440,212)(139,212)])
link(Str6,5052290:Text,[(447,212)(230,212)])
link(Str7,3173948:Text,[(454,212)(314,212)])
link(Str8,6362060:Text,[(461,212)(412,212)])
}
Add(DoData,15645264,406,392)
{
link(onEventData,9992815:doDelete,[(451,398)(451,272)])
link(Data,8514301:Text,[])
}
Add(ChanelToIndex,14369698,406,308)
{
link(onIndex,10538399:doEnabled,[])
}
Add(Hub,6343424,350,294)
{
OutCount=4
link(onEvent1,9992815:doClear,[(445,300)(445,265)])
link(onEvent2,6536108:doWork1,[(383,307)(383,216)])
link(onEvent3,14369698:doWork1,[])
link(onEvent4,1487283:doClear,[(380,321)(380,344)(644,344)(644,55)])
}
Add(ChanelToIndex,6536108,448,210)
{
link(onIndex,4485138:doEnabled,[])
}
Add(ListBox,1487283,651,42)
{
Left=560
Top=27
Width=105
Height=100
}
Add(Label,6121243,595,49)
{
Left=565
Top=2
Width=91
Height=17
Caption="Записано в Excel"
}
Add(HubEx,3685851,168,210)
{
Angle=2
link(onEvent,13091107:doText2,[(142,223)(142,244)])
}
Add(Hub,9555047,91,147)
{
OutCount=3
link(onEvent1,3417919:doText2,[(117,153)(117,141)(30,141)(30,153)])
link(onEvent2,1643601:doSetFocus,[])
link(onEvent3,1643601:doSelectAll,[])
}
Add(Edit,3417919,42,140)
{
Left=370
Top=267
Text="1"
DataType=2
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,9555047:doEvent1,[])
}
Add(Hub,853223,182,147)
{
OutCount=3
link(onEvent1,1643601:doText2,[(208,153)(208,141)(121,141)(121,153)])
link(onEvent2,5052290:doSetFocus,[])
link(onEvent3,5052290:doSelectAll,[])
}
Add(Edit,1643601,133,140)
{
Left=430
Top=267
Width=85
Text="1"
DataType=2
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,853223:doEvent1,[])
}
Add(Hub,170265,273,147)
{
OutCount=3
link(onEvent1,5052290:doText2,[(299,153)(299,141)(212,141)(212,153)])
link(onEvent2,3173948:doSetFocus,[])
link(onEvent3,3173948:doSelectAll,[])
}
Add(Edit,5052290,224,140)
{
Left=520
Top=267
Text="1"
DataType=2
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,170265:doEvent1,[])
}
Add(Hub,6561830,357,147)
{
OutCount=3
link(onEvent1,3173948:doText2,[(383,153)(383,141)(296,141)(296,153)])
link(onEvent2,6362060:doSetFocus,[])
link(onEvent3,6362060:doSelectAll,[])
}
Add(Edit,3173948,308,140)
{
Left=580
Top=267
Text="1"
DataType=2
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,6561830:doEvent1,[])
}
Add(Hub,602910,350,238)
{
OutCount=3
link(onEvent1,15301710:doText2,[(376,244)(376,232)(296,232)(296,244)])
link(onEvent2,3417919:doSetFocus,[(376,251)(376,205)(30,205)(30,160)])
link(onEvent3,3417919:doSelectAll,[(376,258)(376,212)(30,212)(30,167)])
}
Add(Edit,6362060,406,140)
{
Left=640
Top=267
Text="1"
DataType=2
Point(doSetFocus)
Point(doSelectAll)
link(onEnter,5077774:doEvent1,[(443,153)(443,146)])
}