Вверх ↑
Этот топик читают: Гость
Ответов: 783
Рейтинг: 168
#31: 2021-03-01 05:55:16 ЛС | профиль | цитата
Пример передачи данных в Excel с помощью формул вида « =server |topic!item »

Add(MainForm,2953706,70,112)
{
Width=389
Height=222
Caption="TestsDDEserver"
Point(onClose)
link(onCreate,13272898:doStart,[])
link(onClose,13272898:doStop,[])
}
Add(DDEServer,13272898,126,126)
{
ServiceName="Test"
TopicList=#5:topic|
link(onGetItem,9994146:doGetIndex,[])
}
Add(Label,7157217,588,140)
{
Left=15
Top=45
Width=125
Caption="=Test|topic!item"
Underline=0
CaptionOnClick=0
Point(onDblClick)
link(onClick,15894363:doWork2,[])
}
Add(StrList,9994146,175,98)
{
Strings=#15:StdDocumentName|4:item|5:item1|5:item2|
Point(doGetIndex)
Point(onGetIndex)
Point(StrToFind)
link(onGetIndex,14199659:doEvent,[])
}
Add(IndexToChanel,14199659,224,105)
{
Count=4
link(onEvent2,342458:doData,[])
link(onEvent3,2228487:doNext,[])
link(onEvent4,9458303:doRandom,[])
}
Add(Random,9458303,378,126)
{
Max=1000
link(onRandom,15574439:doEvent3,[])
}
Add(Clipboard,7091608,651,140)
{
}
Add(Button,9454402,175,259)
{
Left=35
Top=130
Width=84
Caption="Старт"
Point(doCaption)
link(onClick,4396771:doSwitch,[])
}
Add(DDEClient,12344087,406,238)
{
ServiceName="EXCEL"
TopicName="system"
AutoUpdate=1
Point(doExecute)
Point(onError)
}
Add(FormatStr,12590960,357,266)
{
Mask="[UPDATE.LINK("Test|topic!item", 2)][UPDATE.LINK("Test|topic!item1", 2)][UPDATE.LINK("Test|topic!item2", 2)]"
link(onFString,12344087:doExecute,[])
}
Add(Time,5482872,280,56)
{
Format=" D-M-Y h:m:s"
}
Add(DoData,342458,280,112)
{
link(onEventData,15574439:doEvent1,[])
link(Data,5482872:FormatTime,[])
}
Add(ScrollBar,12006976,175,315)
{
Left=145
Top=135
Width=200
Height=10
Max=2000
Min=50
Page=50
Position=500
link(onPosition,14794351:doEvent1,[])
}
Add(Switch,4396771,231,259)
{
DataOn=String(Стоп)
DataOff=String(Старт)
Point(onOn)
Point(onOff)
link(onSwitch,9454402:doCaption,[(277,265)(277,251)(165,251)(165,265)])
link(onOn,11680365:doWork2,[])
link(onOff,3060626:doWork2,[])
}
Add(Hub,14794351,238,315)
{
OutCount=3
link(onEvent1,3060626:doWork3,[(277,321)])
link(onEvent2,5546050:doInterval,[(291,328)(291,286)])
link(onEvent3,11680365:doWork3,[(284,335)])
}
Add(HubEx,3060626,273,273)
{
link(onEvent,5546050:doStop,[])
}
Add(HubEx,11680365,280,266)
{
link(onEvent,5546050:doTimer,[])
}
Add(Label,2692982,588,189)
{
Left=15
Top=60
Width=125
Caption="=Test|topic!item1"
Underline=0
CaptionOnClick=0
Point(onDblClick)
link(onClick,13931715:doWork2,[])
}
Add(Label,6463094,588,238)
{
Left=15
Top=75
Width=125
Caption="=Test|topic!item2"
Underline=0
CaptionOnClick=0
Point(onDblClick)
link(onClick,13931715:doWork3,[(634,244)])
}
Add(CounterEx,2228487,329,119)
{
link(onNext,15574439:doEvent2,[])
}
Add(Hub,15574439,427,112)
{
InCount=3
OutCount=1
link(onEvent1,13272898:doReturnItem,[(473,118)(473,167)(116,167)(116,146)])
}
Add(HubEx,15894363,630,140)
{
link(onEvent,7091608:doPutText,[])
}
Add(HubEx,13931715,630,189)
{
Angle=3
link(onEvent,15894363:doWork3,[])
}
Add(Timer,5546050,308,266)
{
Enable=1
Point(doInterval)
link(onTimer,12590960:doString,[])
}
Add(Label,68095,588,91)
{
Left=15
Top=10
Width=379
Height=32
Caption="Щёлкните по ссылке для копирования в буфер\r\nи вставте в Excel"
AutoSize=1
}
Add(Label,16459944,126,315)
{
Left=150
Top=115
Width=205
Height=17
Caption="Время обновления данных (50-2000 мс)"
}

Запустите программу. Откройте Excel и вставьте в ячейки следующие формулы:
=Test|topic!item
=Test|topic!item1
=Test|topic!item2
Нажмите кнопку «Старт». Также можно менять время обновления данных.
Настройки Excel->Файл->Параметры->Дополнительно->Общие должны быть такими.
Настройки Excel.PNG
Архив с файлами - https://forum.hiasm.com/getfile/39213
карма: 15

1
файлы: 1Hiasm-Excel formulas.zip [21KB] [455]
Голосовали:tig-rrr
Ответов: 783
Рейтинг: 168
#32: 2022-01-15 15:58:56 ЛС | профиль | цитата
Для тех у кого установлен Google Chrome . Пример передача данных из Hiasm в Excel, CSV и PDF.
Ссылка на пример -https://forum.hiasm.com/getfile/39350 (Форум портит схему в тегах - "code")

Редактировалось 1 раз(а), последний 2022-01-15 16:04:52
карма: 15

0
файлы: 1Hiasm to chrome.zip [3.6KB] [350]
Ответов: 783
Рейтинг: 168
#33: 2022-05-03 15:29:11 ЛС | профиль | цитата
Только ради эксперимента. Обрезал у excel практически всё, оставил только таблицу.
Можно выдавать данные и в таком виде. (Проверено на Windows10/64; MS office 2019/64)

Add(MainForm,15391640,224,147)
{
Visible=1
link(onCreate,2062696:doEvent1,[])
}
Add(StrList,5903685,315,105)
{
Strings=#42:Артикул;Название;Кол-во;Ед.изм.;Цена;Сумма|56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|54:23544122;Carbon disc ?44,7/38,3x5,8mm;2;PC;16,92;33,84|64:21200159;Top part UNIFL3/4 for steel bot.part;25;PC;30,09;752,25|57:24400111;Hose f. pump compl. UNIWASH;153;PC;10,58;1618,74|58:13225;Piston complete for valve UNIWASH3;4;PC;27,09;108,36|60:12200105;Vacuumgauge glycerine ?100mm 3/8";5;PC;40,57;202,85|54:21200141;Thread bush UNIFLOW3 steel;130;PC;1,93;250,90|45:25100146;O-ring ?16,1x1,6mm;175;PC;0,36;63,00|57:21200127;Holder rocking lever, UNIFLOW3;170;PC;0,26;44,20|50:21200131;Rocking lever UNIFLOW3;150;PC;0,89;133,50|65:25200132;Valve button inside UNIFLOW3 steel FA;225;PC;0,72;162,00|61:21200129;Bar closing device UNIFLOW3 steel;225;PC;1,09;245,25|55:25200124;Valve flap outside UNIFLOW3;225;PC;1,56;351,00|60:14400212;Solenoid valve sgl. invensys 230vac;5;PC;8,50;42,50|62:14400213;Solenoid valve dobb. invensys 230vac;5;PC;14,13;70,65|48:21200131;Rocking lever UNIFLOW3;20;PC;0,89;17,80|63:25200132;Valve button inside UNIFLOW3 steel FA;20;PC;0,72;14,40|43:25100146;O-ring ?16,1x1,6mm;20;PC;0,36;7,20|55:21200127;Holder rocking lever, UNIFLOW3;20;PC;0,26;5,20|58:21200130;Bar closing device UNIFLOW3 steel;20;PC;0,34;6,80|58:25200119;Guard bracket UNIFLOW3 steel SBS;20;PC;3,38;67,60|55:13474;Valve flap exterior UNIFLOW3 SBS;20;PC;1,56;31,20|59:26400104;Terminal wheel for lock guide str;20;PC;1,12;22,40|67:25215022;Rubber liner UNIFL. 15022-?22 UNIFLEX FA;96;PC;2,39;229,44|55:14800695;Hose guide f. SAC115 complete;10;PC;9,17;91,70|36:14306;Filter for IDC;20;PC;0,40;8,00|51:25515435;Rubber hose ?27/16 mm - FA;15;M;5,24;78,60|63:13930;Double-action Quickstart II rem. L=740mm;1;PC;98,66;98,66|54:13100201;Spray gun for udder washer;20;PC;17,77;355,40|0:|
}
Add(StreamConvertor,16688297,364,161)
{
Mode=7
link(onResult,13611874:doCreate,[])
}
Add(TempFileStream,13611874,413,161)
{
Extention=".txt"
link(onCreate,15816150:doString,[])
}
Add(FormatStr,15816150,462,161)
{
Mask="Dim objExcel, iCommandBar\r\n\r\nSet objExcel = CreateObject("Excel.Application")\r\nSet objWorkbook = objExcel.Workbooks.Open("%1")\r\nSet iCommandBar = objExcel.CommandBars\r\nWith objExcel\r\n .Visible = False\r\n .ScreenUpdating = False\r\n .Workbooks(1).Windows(1).Caption = ""\r\n .Caption = "Excel reduction"\r\n .DisplayStatusBar = False \r\n .DisplayFormulaBar = False\r\n .ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"", False)"\r\n With .ActiveWindow\r\n .DisplayHeadings = False\r\n .DisplayGridlines = False\r\n .DisplayHorizontalScrollBar = False \r\n .DisplayVerticalScrollBar = False\r\n .DisplayWorkbookTabs = False\r\n .Height = 500 \r\n .Width = 400 \r\n End With\r\n \r\n For Each iCommandBar In .CommandBars\r\n iCommandBar.Enabled = False\r\n Next \r\n .ActiveSheet.UsedRange.EntireColumn.AutoFit\r\n .ScreenUpdating = True\r\n .Visible = True \r\n .Workbooks(1).Saved = True\r\nEnd With"
link(onFString,4492862:##SetScript,[])
}
Add(VBJScript,4492862,511,161)
{
WorkPoints=#11:##SetScript|
Script=#0:|0:|
UseName=0
}
Add(Replace,2999836,315,161)
{
SubStr=";"
DestStr="\t"
link(onReplace,16688297:doConvert,[])
link(Str,5903685:Text,[])
}
Add(Hub,2062696,273,161)
{
link(onEvent1,2999836:doReplace,[])
link(onEvent2,15391640:doClose,[(298,174)(298,188)(214,188)(214,174)])
}

карма: 15

1
Голосовали:tig-rrr
Ответов: 783
Рейтинг: 168
#34: 2022-06-01 18:28:32 ЛС | профиль | цитата
Пример: Использование встроенного в Excel инструмента - Power Query для веб-запроса и получение табличных HTML данных.
Add(MainForm,6472959,84,119)
{
link(onCreate,12851318:doString,[])
}
Add(VBJScript,4549666,196,133)
{
WorkPoints=#11:##SetScript|
EventPoints=#8:onFinish|
Script=#0:|0:|
UseName=0
link(onFinish,6472959:doClose,[(248,139)(248,180)(74,180)(74,146)])
}
Add(FormatStr,12851318,140,133)
{
DataCount=1
Mask="Dim objExcel, objWorkbook, objWorkSheet, objList\r\n\r\nSet objExcel = CreateObject("Excel.Application")\r\nSet objWorkbook = objExcel.Workbooks.Add()\r\nobjWorkbook.Queries.Add "Table1", "%1"\r\n\r\nSet objWorkSheet = objExcel.Worksheets.Add\r\nobjExcel.CutCopyMode = False\r\nWith objWorkSheet.ListObjects.Add(0, "OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table1", , , objWorkSheet.Range("A1")).QueryTable\r\n' .CommandType = xlCmdSql\r\n .CommandType = 2\r\n .CommandText = Array("SELECT * FROM [Table1]")\r\n .RowNumbers = False\r\n .FillAdjacentFormulas = False\r\n .PreserveFormatting = True\r\n .RefreshOnFileOpen = False\r\n .BackgroundQuery = True\r\n .RefreshStyle = xlInsertDeleteCells\r\n .SavePassword = False\r\n .SaveData = True\r\n .AdjustColumnWidth = True\r\n .RefreshPeriod = 0\r\n .PreserveColumnInfo = True\r\n .ListObject.DisplayName = "Table"\r\n .Refresh BackgroundQuery = 0\r\nEnd With\r\n\r\nobjExcel.Visible = True\r\n\r\nSet objExcel = Nothing\r\nSet objWorkbook = Nothing\r\nSet objWorkSheet = Nothing\r\nsys.onFinish nil\r\n\r\n\r\n"
link(onFString,4549666:##SetScript,[])
link(Str1,2967553:Text,[])
}
Add(VisualStrings,2967553,140,84)
{
Lines=#176:let Source = Web.Page(Web.Contents(""https://forum.hiasm.com/forum/0"")), Data0 = Source{0}[Data], Headlines= Table.PromoteHeaders(Data0, [PromoteAllScalars=true]) in Headlines|
Width=907
Height=25
}

Пример получения данных с сайта https://finance.yahoo.com/cryptocurrencies
Add(MainForm,6472959,140,147)
{
link(onCreate,12851318:doString,[])
}
Add(VBJScript,4549666,252,161)
{
WorkPoints=#11:##SetScript|
EventPoints=#8:onFinish|
Script=#0:|0:|
UseName=0
link(onFinish,6472959:doClose,[(304,167)(304,208)(130,208)(130,174)])
}
Add(FormatStr,12851318,196,161)
{
DataCount=1
Mask="Dim objExcel, objWorkbook, objWorkSheet, objList\r\n\r\nSet objExcel = CreateObject("Excel.Application")\r\nSet objWorkbook = objExcel.Workbooks.Add()\r\nobjWorkbook.Queries.Add "Table1", "%1"\r\n\r\nSet objWorkSheet = objExcel.Worksheets.Add\r\nobjExcel.CutCopyMode = False\r\nWith objWorkSheet.ListObjects.Add(0, "OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table1", , , objWorkSheet.Range("A1")).QueryTable\r\n' .CommandType = xlCmdSql\r\n .CommandType = 2\r\n .CommandText = Array("SELECT * FROM [Table1]")\r\n .RowNumbers = False\r\n .FillAdjacentFormulas = False\r\n .PreserveFormatting = True\r\n .RefreshOnFileOpen = False\r\n .BackgroundQuery = True\r\n .RefreshStyle = xlInsertDeleteCells\r\n .SavePassword = False\r\n .SaveData = True\r\n .AdjustColumnWidth = True\r\n .RefreshPeriod = 0\r\n .PreserveColumnInfo = True\r\n .ListObject.DisplayName = "Table"\r\n .Refresh BackgroundQuery = 0\r\nEnd With\r\n\r\nobjExcel.Visible = True\r\n\r\nSet objExcel = Nothing\r\nSet objWorkbook = Nothing\r\nSet objWorkSheet = Nothing\r\nsys.onFinish nil\r\n\r\n\r\n"
link(onFString,4549666:##SetScript,[])
link(Str1,6939078:Text,[])
}
Add(VisualStrings,6939078,196,112)
{
Lines=#119:let Source = Web.Page(Web.Contents(""https://finance.yahoo.com/cryptocurrencies"")), Data0 = Source {0}[Data] in Data0|
Width=613
Height=25
}


Внизу сообщения вставился другой файл. Как удалить, не понял.

Редактировалось 8 раз(а), последний 2022-06-02 19:51:16
карма: 15

0
файлы: 1Make XLSX without Excel.zip [5.1KB] [303]
Ответов: 783
Рейтинг: 168
#35: 2022-12-10 19:25:54 ЛС | профиль | цитата
Пример экспорт таблицы в Excel(.xls) используя ADOX - https://learn.microsoft.com/en-us/sql/ado/guide/extensions/provider-support-for-adox-ado?redirectedfrom=MSDN&view=sql-server-ver16
Строка подключения - https://www.connectionstrings.com/microsoft-jet-ole-db-4-0/
Add(MainForm,7134060,322,259)
{
Width=592
Height=483
link(onCreate,3024879:doDelete,[])
}
Add(DS_OLEDB,12808009,511,259)
{
Name="xls_db"
Point(onError)
link(onCreate,16109952:doExec,[])
}
Add(FormatStr,11826662,455,259)
{
DataCount=1
Mask="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="%1"; Extended Properties=Excel 8.0"
Point(FString)
link(onFString,12808009:doOpen,[])
link(Str1,15120613:Var2,[])
}
Add(VisualStrings,3042360,455,182)
{
Lines=#9:book1.xls|
Width=67
}
Add(StrList,11016052,609,168)
{
Strings=#56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|54:23544122;Carbon disc ?44,7/38,3x5,8mm;2;PC;16,92;33,84|64:21200159;Top part UNIFL3/4 for steel bot.part;25;PC;30,09;752,25|57:24400111;Hose f. pump compl. UNIWASH;153;PC;10,58;1618,74|58:13225;Piston complete for valve UNIWASH3;4;PC;27,09;108,36|60:12200105;Vacuumgauge glycerine ?100mm 3/8";5;PC;40,57;202,85|54:21200141;Thread bush UNIFLOW3 steel;130;PC;1,93;250,90|45:25100146;O-ring ?16,1x1,6mm;175;PC;0,36;63,00|57:21200127;Holder rocking lever, UNIFLOW3;170;PC;0,26;44,20|50:21200131;Rocking lever UNIFLOW3;150;PC;0,89;133,50|65:25200132;Valve button inside UNIFLOW3 steel FA;225;PC;0,72;162,00|61:21200129;Bar closing device UNIFLOW3 steel;225;PC;1,09;245,25|55:25200124;Valve flap outside UNIFLOW3;225;PC;1,56;351,00|60:14400212;Solenoid valve sgl. invensys 230vac;5;PC;8,50;42,50|62:14400213;Solenoid valve dobb. invensys 230vac;5;PC;14,13;70,65|48:21200131;Rocking lever UNIFLOW3;20;PC;0,89;17,80|63:25200132;Valve button inside UNIFLOW3 steel FA;20;PC;0,72;14,40|43:25100146;O-ring ?16,1x1,6mm;20;PC;0,36;7,20|55:21200127;Holder rocking lever, UNIFLOW3;20;PC;0,26;5,20|58:21200130;Bar closing device UNIFLOW3 steel;20;PC;0,34;6,80|58:25200119;Guard bracket UNIFLOW3 steel SBS;20;PC;3,38;67,60|55:13474;Valve flap exterior UNIFLOW3 SBS;20;PC;1,56;31,20|59:26400104;Terminal wheel for lock guide str;20;PC;1,12;22,40|67:25215022;Rubber liner UNIFL. 15022-?22 UNIFLEX FA;96;PC;2,39;229,44|55:14800695;Hose guide f. SAC115 complete;10;PC;9,17;91,70|36:14306;Filter for IDC;20;PC;0,40;8,00|51:25515435;Rubber hose ?27/16 mm - FA;15;M;5,24;78,60|63:13930;Double-action Quickstart II rem. L=740mm;1;PC;98,66;98,66|54:13100201;Spray gun for udder washer;20;PC;17,77;355,40|0:|
}
Add(ArrayEnum,1512985,623,259)
{
link(onItem,3351570:doEvent1,[])
link(onEndEnum,5339090:doEvent1,[(669,272)(669,307)])
link(Array,11016052:Array,[])
}
Add(MT_String,7011876,805,252)
{
link(onResult,15378171:doString,[])
}
Add(DSC_Exec,16109952,567,259)
{
SQL="CREATE TABLE [TestTable] (\r\n[Артикул] VarChar(255), \r\n[Название] VarChar(255), \r\n[Кол-во] Double, \r\n[Ед.изм.] VarChar(255), \r\n[Цена] Double, \r\n[Сумма] Double\r\n)"
DSManager="xls_db"
link(onExec,1512985:doEnum,[])
}
Add(FormatStr,15378171,854,252)
{
DataCount=6
Mask="INSERT INTO TestTable VALUES ('%1','%2','%3','%4','%5','%6');"
link(onFString,9651247:doExec,[])
}
Add(DSC_Exec,9651247,924,252)
{
DSManager="xls_db"
}
Add(FileTools,3024879,392,259)
{
FileName="book1.xls"
link(onEnd,11826662:doString,[])
link(FileName,15120613:Var1,[(398,222)])
}
Add(GetDataEx,15120613,455,217)
{
link(Data,3042360:Text,[])
}
Add(WinExec,5759325,728,301)
{
link(FileName,15120613:Var3,[(734,222)])
}
Add(Hub,5339090,679,301)
{
link(onEvent1,12808009:doClose,[(705,307)(705,330)(501,330)(501,272)])
link(onEvent2,5759325:doShellExec,[])
}
Add(StringTable,7718047,805,203)
{
Width=576
Height=444
Align=5
Columns=#7:Артикул|9:Название |7:Кол-во |7:Ед.изм.|5:Цена |5:Сумма|0:|
Point(Strings)
}
Add(Hub,3351570,763,259)
{
link(onEvent1,7718047:doAdd,[(788,265)(788,209)])
link(onEvent2,7011876:doMTString,[])
}


То же самое, но на VBJScript
Add(MainForm,2953706,70,105)
{
Width=624
Height=446
link(onCreate,3024879:doDelete,[])
}
Add(StrList,11016052,189,49)
{
Strings=#56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|54:23544122;Carbon disc ?44,7/38,3x5,8mm;2;PC;16,92;33,84|64:21200159;Top part UNIFL3/4 for steel bot.part;25;PC;30,09;752,25|57:24400111;Hose f. pump compl. UNIWASH;153;PC;10,58;1618,74|58:13225;Piston complete for valve UNIWASH3;4;PC;27,09;108,36|60:12200105;Vacuumgauge glycerine ?100mm 3/8";5;PC;40,57;202,85|54:21200141;Thread bush UNIFLOW3 steel;130;PC;1,93;250,90|45:25100146;O-ring ?16,1x1,6mm;175;PC;0,36;63,00|57:21200127;Holder rocking lever, UNIFLOW3;170;PC;0,26;44,20|50:21200131;Rocking lever UNIFLOW3;150;PC;0,89;133,50|65:25200132;Valve button inside UNIFLOW3 steel FA;225;PC;0,72;162,00|61:21200129;Bar closing device UNIFLOW3 steel;225;PC;1,09;245,25|55:25200124;Valve flap outside UNIFLOW3;225;PC;1,56;351,00|60:14400212;Solenoid valve sgl. invensys 230vac;5;PC;8,50;42,50|62:14400213;Solenoid valve dobb. invensys 230vac;5;PC;14,13;70,65|48:21200131;Rocking lever UNIFLOW3;20;PC;0,89;17,80|63:25200132;Valve button inside UNIFLOW3 steel FA;20;PC;0,72;14,40|43:25100146;O-ring ?16,1x1,6mm;20;PC;0,36;7,20|55:21200127;Holder rocking lever, UNIFLOW3;20;PC;0,26;5,20|58:21200130;Bar closing device UNIFLOW3 steel;20;PC;0,34;6,80|58:25200119;Guard bracket UNIFLOW3 steel SBS;20;PC;3,38;67,60|55:13474;Valve flap exterior UNIFLOW3 SBS;20;PC;1,56;31,20|59:26400104;Terminal wheel for lock guide str;20;PC;1,12;22,40|67:25215022;Rubber liner UNIFL. 15022-?22 UNIFLEX FA;96;PC;2,39;229,44|55:14800695;Hose guide f. SAC115 complete;10;PC;9,17;91,70|36:14306;Filter for IDC;20;PC;0,40;8,00|51:25515435;Rubber hose ?27/16 mm - FA;15;M;5,24;78,60|63:13930;Double-action Quickstart II rem. L=740mm;1;PC;98,66;98,66|54:13100201;Spray gun for udder washer;20;PC;17,77;355,40|
}
Add(StringTable,7718047,259,105)
{
Width=608
Height=407
Align=5
Columns=#7:Артикул|9:Название |7:Кол-во |7:Ед.изм.|5:Цена |5:Сумма|0:|
Point(Strings)
}
Add(VBJScript,3595730,189,105)
{
WorkPoints=#6:doWork|
EventPoints=#6:onRead|7:onStart|
DataPoints=#3:csv|5:count|
Script=#22:Sub doWork(Data,Index)|102:Const adDouble = 5, adDate = 7, adCurrency = 6, adBoolean = 11, adVarWChar = 202, adLongVarWChar = 203|53:Dim cat, tbl, col, oRs, oCon, arrLines, strLine, vals|0:|38:Set cat = Createobject("ADOX.Catalog")|111:cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=cbook3.xls;Extended Properties=Excel 8.0"|36:Set tbl = Createobject("ADOX.Table")|22:tbl.Name = "TestTable"|0:|37:Set col = Createobject("ADOX.Column")|8:With col|21: .Name = "Артикул"|22: .Type = adVarWChar|8:End With|22:tbl.Columns.Append col|17:Set col = Nothing|0:|37:Set col = Createobject("ADOX.Column")|8:With col|22: .Name = "Название"|22: .Type = adVarWChar|8:End With|22:tbl.Columns.Append col|17:Set col = Nothing|0:|37:Set col = Createobject("ADOX.Column")|8:With col|20: .Name = "Кол-во"|20: .Type = adDouble|8:End With|22:tbl.Columns.Append col|17:Set col = Nothing|0:|37:Set col = Createobject("ADOX.Column")|8:With col|21: .Name = "Ед.изм."|22: .Type = adVarWChar|8:End With|22:tbl.Columns.Append col|17:Set col = Nothing|0:|37:Set col = Createobject("ADOX.Column")|8:With col|18: .Name = "Цена"|20: .Type = adDouble|8:End With|22:tbl.Columns.Append col|17:Set col = Nothing|0:|37:Set col = Createobject("ADOX.Column")|8:With col|19: .Name = "Сумма"|20: .Type = adDouble|8:End With|22:tbl.Columns.Append col|17:Set col = Nothing|0:|21:cat.Tables.Append tbl|0:|31:Set oCon = cat.ActiveConnection|0:|44:arrLines = Split(sys.csv, vbCrLf, sys.count)|0:|28:For Each strLine in arrLines|27: vals = Split(strLine, ";")|19: sys.onRead strLine|170: Set oRs = oCon.Execute("INSERT INTO TestTable VALUES ('"& vals(0) & "', '" & vals(1) & "', '" & vals(2) & "', '" & vals(3) & "', '" & vals(4) & "', '" & vals(5) & "' )")|4:Next|0:|17:Set oRs = Nothing|18:Set oCon = Nothing|17:Set tbl = Nothing|17:Set cat = Nothing|0:|15:sys.onStart nil|4: |7:End Sub|
UseName=0
link(onRead,7718047:doAdd,[])
link(onStart,5759325:doShellExec,[(249,118)(249,167)])
link(csv,11016052:Text,[])
link(count,11016052:Count,[])
}
Add(FileTools,3024879,133,105)
{
FileName="cbook3.xls"
link(onEnd,3595730:doWork,[])
}
Add(WinExec,5759325,259,154)
{
FileName="cbook3.xls"
}


Редактировалось 3 раз(а), последний 2022-12-12 05:48:23
карма: 15

0
Ответов: 783
Рейтинг: 168
#36: 2023-01-06 13:41:02 ЛС | профиль | цитата
Взял dll-ку из этого поста - https://forum.hiasm.com/post/303992
и сделал свой пример передачи данных из Hiasm в Excell.
https://forum.hiasm.com/getfile/39571
Проверено на
- Hiasm v4.05 build 186
- Windows 10
- MS Office 365
карма: 15

0
36
Сообщение
...
Прикрепленные файлы
(файлы не залиты)