-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcABCGas.vbs
More file actions
1892 lines (1733 loc) · 105 KB
/
Copy pathcABCGas.vbs
File metadata and controls
1892 lines (1733 loc) · 105 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Option Explicit
Function lanzaPrg (strPrgCmd, strTitleFindPattern, ByRef oExec, ByRef arrPosSize)
strftmp = fso.GetSpecialFolder(2) & "\" & fso.GetTempName()
Wshshell.Run "guipropview /stext """ & strftmp & """ /filter Title:""" & strTitleFindPattern & """",0,true
regex.Pattern = "Handle\s+:\s*(\S+)(?:[\s\S](?!==))+?Title[^\r\n]+?" & Replace(strTitleFindPattern,"*",".*") & "(?:[\s\S](?!==))+?Position\s+:\s*(\d+),\s*(\d+)(?:[\s\S](?!==))+?Size\s+:\s*(\d+),\s*(\d+)[\s\S]+?={3,}"
Set ExistingWND = Nothing
If fso.GetFile (strftmp).Size > 4 Then Set ExistingWND = regex.Execute(fso.OpenTextFile (strftmp,1,0,-1).ReadAll)
fso.DeleteFile strftmp,True
Set oExec = Wshshell.Exec (strPrgCmd)
Do
' Set oExec = WshShell.Exec ("guipropview /Action SwitchTo Title:""" & strTitleFindPattern & """")
' Do While oExec.Status = 0
' If Not oExec.StdOut.AtEndOfStream Then
' out = oExec.StdOut.Read
' End If
' WScript.Sleep 100
' Loop
WScript.Sleep 1000
Wshshell.Run "guipropview /stext """ & strftmp & """ /filter Title:""" & strTitleFindPattern & """",0,true
regex.Pattern = "Handle\s+:\s*(\S+)(?:[\s\S](?!==))+?Title[^\r\n]+?" & Replace(strTitleFindPattern,"*",".*") & "(?:[\s\S](?!==))+?Position\s+:\s*(\d+),\s*(\d+)(?:[\s\S](?!==))+?Size\s+:\s*(\d+),\s*(\d+)[\s\S]+?={3,}"
If fso.GetFile (strftmp).Size > 4 Then
Set NewWND = regex.Execute(fso.OpenTextFile (strftmp,1,0,-1).ReadAll)
For Each tmpWN In NewWND
If ExistingWND is Nothing Then
lanzaPrg = tmpWN.submatches(0)
arrPosSize = Array (tmpWN.submatches(1),tmpWN.submatches(2),tmpWN.submatches(3),tmpWN.submatches(4))
else
For Each prevWN In ExistingWND
If tmpWN.Value <> prevWN.Value Then
lanzaPrg = tmpWN.submatches(0)
arrPosSize = Array (tmpWN.submatches(1),tmpWN.submatches(2),tmpWN.submatches(3),tmpWN.submatches(4))
Exit For
End If
Next
End if
If Not IsEmpty (lanzaPrg) Then Exit For
Next
End If
fso.DeleteFile strftmp,True
Loop While IsEmpty (lanzaPrg)
End Function
Function getAireGasControlIDs (strAireHND, oDicControls)
strftmp = fso.GetSpecialFolder(2) & "\" & fso.GetTempName()
Wshshell.Run "guipropview /stext """ & strftmp & """ /ParentWindow " & strAireHND ,0,True
'Stop
strControls = fso.OpenTextFile (strftmp,1,0,-1).ReadAll
Set oDicControls = CreateObject("scripting.dictionary")
For Each arrControl In Array (Array("Guardar",73,"GuardarEtapas"),Array("Calcular",82,"CalcularEtapas"))
regex.Pattern = "Handle\s+:\s*(\S+)(?:[\s\S](?!==))+?Text[\s:]*(" & arrControl(0) & ")(?:[\s\S](?!==))+?Z-order\s+:\s*(" & arrControl(1) & ")(?:[\s\S](?!==))+?Position\s+:\s*(\d+),\s*(\d+)(?:[\s\S](?!==))+?Size\s+:\s*(\d+),\s*(\d+)(?:[\s\S](?!==))+?Class Atom\s+:\s*(\d+)[\s\S]+?={3,}"
Set AireControls = regex.Execute(strControls)
For Each Control In AireControls
oDicControls.Add arrControl(2), Array (Control.submatches(0),Control.submatches(1),Control.submatches(2), _
Control.submatches(3), Control.submatches(4),Control.submatches(5),Control.submatches(6), _
Control.submatches(7)) ' Handle, Text, Z-order, Positionx, y , Sizex, y, Atom
Next
Next
fso.DeleteFile strftmp,True
End Function
Function getAireGasControlCoords (oDicControls)
' usar con start /wait guipropview /Action SwitchTo Handle:(Handle de AireGas) & nircmd setcursorwin x y & nircmd sendmouse left click
' para las coordenadas x, y, sumar +30, +40 respecto a las coords del control que da guipropview
oDicControls.Add "TabCalcCompresor", Array (72, 153) ' (22, 113)
oDicControls.Add "CompresorSerie", Array (88, 205) ' (58, 165)
oDicControls.Add "SeleccCalc", Array (960, 101) ' (930, 61)
oDicControls.Add "OpcCalc", Array (1077, 101) ' (1047, 61)
oDicControls.Add "CalcularEtapas", Array (519, 443) ' (489, 403)
oDicControls.Add "Errores", Array (995, 440) ' (965, 400)
oDicControls.Add "TabGas", Array (519, 205) ' (489, 165)
oDicControls.Add "TabCilindros", Array (569, 205) ' ??
oDicControls.Add "TabRefrigeradores", Array (639, 205) ' ??
oDicControls.Add "TabAireBaja", Array (729, 205) ' ??
oDicControls.Add "TabRegulacionSets", Array (829, 205) ' ??
oDicControls.Add "TabCalcAhorro", Array (182, 153)
oDicControls.Add "TabCalcVTPares", Array (232, 153)
oDicControls.Add "TabCalcPotCau", Array (287, 153)
oDicControls.Add "TabCalcAntipul", Array (342, 153)
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' deberia tener distintas clases para distintos tipos de resultados:
' cABCGas_XLS (deberia cambiar de nombre) es PARA UN MODELO CONCRETO DE COMPRESOR, indep de los ficheros de resultados (varios ficheros de resultados, O VARIAS OPCIONES, podrían converger a esta clase)
' para los ficheros MULTI, habría una "CLASE DE COMPARACION DE MODELOS", con UN DICCIONARIO que almacecene cada calculo...
' habría que sacar las funciones comunes...
' (y para otros ficheros pueden aparecer otras clases...)
Class cABCGas_XLS
Private regex
Private strNACEcheckFPath, strCylsPreMatcheckFPath
Dim strXLSXPath,bSave
Dim oCellAutor, oCellFecha, oCellCalculo, oCellCliente, oCellProyecto, oCellObservaciones
Dim oCell_Gas_Pcrit, oCell_Gas_Tcrit, oCell_Gas_Zcrit, oCell_Gas_Znorm, oCell_Gas_GammaNorm, oCell_Gas_GammaAsp, oCell_Gas_MW
Dim oCell_Compressor_Serie, oCell_Compressor_Lubr, oCell_Compressor_Refrig, oCell_Compressor_Tipo, oCell_Compressor_Model
Dim oCell_INProcess_Flow, oCell_INProcess_FlowAtRefHumid, oCell_INProcess_Pescape, oCell_INProcess_RPM, oCell_INProcess_FullENgine
Dim oCell_Process_CompRatio_Global, oCell_Process_CompRatio_Mean, oCell_INProcess_Paspirac, oCell_INProcess_Patm, oCell_INProcess_Taspirac, oCell_INProcess_Tamb
Dim oCell_INProcess_HRamb, oCell_INProcess_Taguarefrig, oCell_INProcess_RefrAceite, oCell_INProcess_DeltaTaguarefrigES, oCell_INProcess_DirtFact_Int, oCell_INProcess_DirtFact_Ext
Dim oCell_OUTProcess_Flow, oCell_OUTProcess_RPM, oCell_OUTProcess_Paspirac, oCell_OUTProcess_Wabsorb, oCell_OUTProcess_Winst, oCell_OUTProcess_MechLoss, oCell_OUTProcess_NuIsoterm
Dim oCell_OUTProcess_Pow_perUnitVol, oCell_OUTProcess_CoolingWaterFlow, oCell_OUTProcess_Condens, oCell_OUTProcess_Heat, oCell_OUTProcess_VentAir, oCell_OUTProcess_PistonMeanSpeed
Dim oDicGasComp,bAire,bHumedo,bATEX_Inflamable,bSafeZone, bN2, bH2, bO2, bH2O, bCO, bCO2, bAR, bNH3, bSH2, bC2H4, bHCs
Dim oDicStages,ncils
Dim PotenciakW,bCompetitivosPorPotencia,RPM
Dim strTipoCalculo ' "Rated, para seleccion de etapas y cilindros" | "A vueltas fijas, Design" (puede ser Pescape > PescapeRated (max, disparo valvulas), o Paspirac < PaspiracRated, ...: AQUI NO PUEDO DIFERENCIARLOS!!!
Dim m_bAPI618
Private m_ExcelApp
Private m_ExcelFMFile ' cExcelFile wrapper del archivo principal
Private Sub Class_Initialize()
On Error Resume Next
strNACEcheckFPath = getResource("strNACEcheckFPath")
strCylsPreMatcheckFPath = getResource("strCylsPreMatcheckFPath")
On Error GoTo 0
If Not fso.fileExists (strNACEcheckFPath) Then _
strNACEcheckFPath = "C:\abc compressors\INTRANET\OficinaTecnica\Documentacion\Normas\NACE\Herramienta\Herramienta_para_seleccion_de_materiales_v1.4.xlsx"
If Not fso.fileExists (strCylsPreMatcheckFPath) Then _
strCylsPreMatcheckFPath = "C:\abc compressors\INTRANET\OilGas\3_OFERTAS\ADJUNTOS OFERTAS\Datos cilindros 2.xlsx"
Set regex = New RegExp
regex.Global = True : regex.IgnoreCase = True : regex.multiline = False
Set oDicGasComp = CreateObject("scripting.dictionary")
Set oDicStages = CreateObject("scripting.dictionary")
Set m_ExcelApp = Nothing
Set m_ExcelFMFile = Nothing
Set oLimitsFeatsReqs_ = Nothing
End Sub
Private Sub Class_Terminate()
'Stop : Call CloseWorkBook() ' NO DEBERIA NECESITAR ESTA LLAMADA, EN TANTO QUE USE EL EXCELMANAGER...
End Sub
Private Property Get objExcel
If m_ExcelApp Is Nothing Then
Err.Raise 91, "cABCGas", "ExcelApp not initialized. Call Init() first."
End If
Set objExcel = m_ExcelApp.Application
End Property
' =============================================
' INICIALIZACIÓN
' =============================================
Public Function Init(ExcelApp, strXLSXPath_, bAPI618)
Set Init = Me
strXLSXPath = strXLSXPath_
Set m_ExcelApp = ExcelApp
m_bAPI618 = bAPI618
Set m_ExcelFMFile = m_ExcelApp.OpenFile(strXLSXPath, False, False)
If getGASSheetInfo () Is Nothing Then
'Set Init = Nothing
Stop : Call CloseWorkBook ' pte de comprobar si lo hago aqui, o en el destructor...: SE CIERRA FUERA, O EN EL DESTRUCTOR, "Init" SIEMPRE dejara el fichero abierto
Exit Function
End If
' Redirigir salida a DOC
MsgIE.setContainer "doc"
MsgIE ("Cliente: <b>" & oCellCliente.Value & "</b>")
MsgIE ("Proyecto: <b>" & oCellProyecto.Value & "</b>")
MsgIE ("Observaciones: <b>" & oCellObservaciones.Value & "</b>")
MsgIE.popContainer
' Inicializo las secciones de volcado de datos para ese calculo:
'SEGUIR AQUI
' DESCARTANDO SOLUCIONES IMPOSIBLES:
Call MsgIE.Spoiler (True,"background-color:orange;color:black;", "ADVERTENCIAS","id" & oCellCalculo.Value & "Advert",True)
If ncils mod 2 <> 0 And ncils <> 1 Then
MsgIE ("- NO SE HA PUESTO UN NUMERO PAR DE CILINDROS, no se puede fabricar como COMPRESOR HORIZONTAL")
Set Init = Nothing
'Exit Function
End If
If oCell_Compressor_Serie = "HG" Then
If m_bAPI618 And bH2 Then
MsgBox ("El compresor es API-618, para H2, HACERLO EN PLATAFORMA HP")
ElseIf m_bAPI618 Then
MsgBox ("El compresor es API-618, CONVIENE HACERLO EN PLATAFORMA HP")
ElseIf bH2 Then
MsgBox ("Muy posiblemente el compresor es API-618 (H2), CONVIENE HACERLO EN PLATAFORMA HP")
End If
MsgIE ("SI EL COMPRESOR ES API-618 (H2, gas natural, etc, o por especificación de cliente). CONVIENE HACERLO <b>MEJOR EN PLATAFORMA HP!!!</b>.")
'Set Init = Nothing
'Exit Function
End If
If oCell_Compressor_Serie & "-" & ncils = "HG-6" Then
MsgIE ("ESTE MODELO, " & "<b>HG-6</b>" & ", NO SE FABRICA, debería calcularse como un HP4.")
Set Init = Nothing
'Exit Function
End If
If Not bCompetitivosPorPotencia Then
MsgIE ("NO SOMOS COMPETITIVOS en las condiciones de calculo de '" & fso.GetBaseName(strXLSXPath) & "' el compresor es de MUY baja potencia: " & PotenciakW & _
" kW. *** CONVENDRIA CONSIDERAR LAS PLATAFORMAS ""V"" Y/O ""X"", que son DE SIMPLE EFECTO, aunque más proclives a FUGAS, se está estudiando añadirles un sistema de RECUPERACION DE FUGAS... Si no, DECLINAR OFERTA")
'Set Init = Nothing
'Exit Function
End If
If ncils = 1 And oDicStages.Count < 2 Then MsgIE vbtab & "el compresor es MANCO, ojo a requisitos"
If InStr (oCell_Compressor_Serie,"HX") > 0 And ncils > 2 Then _
MsgIE vbtab & "NO SE HA HECHO NINGUN COMPRESOR " & oCell_Compressor_Serie & "-" & ncils & ", en HX sólo se ha hecho un HX2, para REPSOL..."
If bAire Then MsgIE vbtab & "Asegurarse de que el compresor " & strModelName & ", que es de aire, NO SE PUEDA OFERTAR COMO PLATAFORMA LP, de máquina estándar (llegan hasta 1000 rpm), o como SYNCRO."
MsgIE.popContainer ' "id" & oCellCalculo.Value & "Advert"
'Stop ' puede que aqui tb se justifique CERRAR EL WORKBOOK
' Generar resumen en MAIN
Call ToUISummary()
End Function
Public Sub ToUISummary()
MsgIE.setContainer "main"
' Placeholder para el resumen en el panel principal
MsgIE.MsgMain "info", "<b>" & strModelName & "</b> (" & strTipoCalculo & ") - " & PotenciakW & " kW"
MsgIE.popContainer
End Sub
Public Function CloseWorkBook()
If Not (m_ExcelFMFile Is Nothing) Then
If bSave Then m_ExcelFMFile.Save
m_ExcelApp.CloseFile m_ExcelFMFile.FilePath, False
Set m_ExcelFMFile = Nothing
End If
End Function
Private Function CellValue (oCell) ' extrae el valor numerico de una celda
regex.Pattern = "^([\-,\.\d]+)\s+(.+)$"
CellValue = CDbl(regex.Execute (oCell.Value).Item(0).Submatches(0))
End Function
Private Function CellUnits (oCell) ' extrae las unidades del valor de una celda
regex.Pattern = "^([\-,\.\d]+)\s+(.+)$"
CellUnits = regex.Execute (oCell.Value).Item(0).Submatches(1)
End Function
Private Function getGasName (Cell)
getGasName = Trim(Replace(Cell.Value,":",""))
End Function
Private Function getGasComp (Cell)
getGasComp = Replace(oDicGasComp(Cell)(0).Value,"%","") * 1
End Function
Public Property Get strCalcOpc ()
If Not IsEmpty (oCellCalculo) Then
strCalcOpc = oCellCalculo.Value
End if
End Property
Private oGASXSLSheet_
Private Function getGASSheetInfo ()
' OBTIENE INFORMACION DE LA HOJA 'GAS' DEL FICHERO DE EXCEL
If Not IsEmpty (oGASXSLSheet_) Then
Set getGASSheetInfo = oGASXSLSheet_
Exit Function ' SOLO SE PROCESA UNA VEZ esta función: la info que lee NO CAMBIA, --> NO tiene sentido hacerlo más veces
End If
If m_ExcelFMFile Is Nothing Then
Set getGASSheetInfo = Nothing
Exit Function
End If
If Not m_ExcelFMFile.HasWorksheet("GAS") Then
Set getGASSheetInfo = Nothing
Exit Function
End If
Dim oXlSheet
Set oXlSheet = m_ExcelFMFile.GetWorksheet("GAS")
' genero referencias para todos los valores de la hoja
Set oCellAutor = oXlSheet.range ("H5")
Set oCellFecha = oXlSheet.range ("H6")
Dim c,oCellGasName,oCellGasPC,oCellGasDesc
c = 10
Set oCellCalculo = oXlSheet.range ("B" & c) : c = c + 1
Set oCellCliente = oXlSheet.range ("B" & c) : c = c + 1
Set oCellProyecto = oXlSheet.range ("B" & c) : c = c + 1
Set oCellObservaciones = oXlSheet.range ("B" & c) : c = c + 1
c = 20
Set oCell_Gas_Pcrit = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_Gas_Tcrit = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_Gas_Zcrit = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_Gas_Znorm = oXlSheet.range ("B" & c) : c = c + 1
' Gamma = peso especifico
Set oCell_Gas_GammaNorm = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_Gas_GammaAsp = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_Gas_MW = oXlSheet.range ("B" & c) : c = c + 1
If CDbl(oCell_Gas_MW.Value) < 12 Then bATEX_Inflamable = True
Dim strGasName, gasComp
For c = 19 To 28
If oXlSheet.range ("F" & c).Value = "" Then Exit For
Set oCellGasName = oXlSheet.range ("F" & c)
Set oCellGasPC = oXlSheet.range ("G" & c)
Set oCellGasDesc = oXlSheet.range ("H" & c)
oDicGasComp.Add oCellGasName, Array (oCellGasPC, oCellGasDesc)
strGasName = getGasName(oCellGasName)
gasComp = getGasComp(oCellGasName)
If InStr(strGasName,"Air") > 0 Then bAire = True
If strGasName="H2O" And gasComp > 1 Then bHumedo = True
regex.Pattern = "C\d*H\d*"
If (strGasName="H2" Or regex.Test (strGasName)) And gasComp > 1 Then bSafeZone = True
bN2 = bN2 Or (strGasName="N2")
bH2 = bH2 Or (strGasName="H2")
bO2 = bO2 Or (strGasName="O2")
bH2O = bH2O Or (strGasName="H2O")
bCO = bCO Or (strGasName="CO")
bCO2 = bCO2 Or (strGasName="CO2")
bAR = bAR Or (strGasName="AR")
bNH3 = bNH3 Or (strGasName="NH3")
bSH2 = bSH2 Or (strGasName="SH2")
bC2H4 = bC2H4 Or (strGasName="C2H4")
Select Case strGasName
Case "CH4","C2H6","C3H8","C4H10","C5H12"
bHCs = True
End Select
Next
c = 30
Set oCell_Compressor_Serie = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_Compressor_Lubr = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_Compressor_Refrig = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_Compressor_Tipo = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_Compressor_Model = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_INProcess_Flow = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_INProcess_FlowAtRefHumid = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_INProcess_Pescape = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_INProcess_RPM = oXlSheet.range ("B" & c) : c = c + 1 ' FIJARSE QUE NOS ESTÁ DANDO EL LIMITE DE VELOCIDAD!!!
Set oCell_INProcess_FullEngine = oXlSheet.range ("B" & c) : c = c + 1 ' ES UN COMENTARIO...
Set oCell_Process_CompRatio_Global = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_Process_CompRatio_Mean = oXlSheet.range ("B" & c) : c = c + 1
c = 30
Set oCell_INProcess_Paspirac = oXlSheet.range ("I" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_INProcess_Patm = oXlSheet.range ("I" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_INProcess_Taspirac = oXlSheet.range ("I" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_INProcess_Tamb = oXlSheet.range ("I" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_INProcess_HRamb = oXlSheet.range ("I" & c) : c = c + 1
Set oCell_INProcess_Taguarefrig = oXlSheet.range ("I" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
c = 38
Set oCell_INProcess_RefrAceite = oXlSheet.range ("I" & c) : c = c + 1
Set oCell_INProcess_DeltaTaguarefrigES = oXlSheet.range ("I" & c) : c = c + 1
Set oCell_INProcess_DirtFact_Int = oXlSheet.range ("I" & c) : c = c + 1
Set oCell_INProcess_DirtFact_Ext = oXlSheet.range ("I" & c) : c = c + 1
c = 46
Set oCell_OUTProcess_Flow = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_OUTProcess_RPM = oXlSheet.range ("B" & c) : c = c + 1 ' (APARECE EN FORMATO / num (num): QUE SON???
Set oCell_OUTProcess_Paspirac = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_OUTProcess_Wabsorb = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!! y valores en unidades alternativas
Set oCell_OUTProcess_Winst = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!! y valores en unidades alternativas
Set oCell_OUTProcess_MechLoss = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
' Rendimiento = Nu
Set oCell_OUTProcess_NuIsoterm = oXlSheet.range ("B" & c) : c = c + 1
Set oCell_OUTProcess_Pow_perUnitVol = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_OUTProcess_CoolingWaterFlow = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_OUTProcess_Condens = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_OUTProcess_Heat = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_OUTProcess_VentAir = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
Set oCell_OUTProcess_PistonMeanSpeed = oXlSheet.range ("B" & c) : c = c + 1 ' HAY QUE IDENTIFICAR LAS UNIDADES!!!
regex.Pattern = "^([\-,\.\d]+)\s*/\s*([\-,\.\d]+)\s+([^/]+)(?:\s*/\s*(.+))$" '251,81 / 185,20 CV/KW
'PotenciakW = regex.Execute(Replace(oCell_OUTProcess_Winst,",",".")).Item(0).submatches(1)
PotenciakW = CDbl(regex.Execute(oCell_OUTProcess_Winst).Item(0).submatches(1))
' para potencias de menos de 25 kW, NO SOMOS COMPETITIVOS...
bCompetitivosPorPotencia = PotenciakW > 25
regex.Pattern = "^([\-,\.\d]+)(?:\s*/\s*([\-,\.\d]+)\s+\(\s+([\-,\.\d]+)\s+\))?\s*$" '251,81 / 0 (0)
'RPM = regex.Execute(Replace(oCell_OUTProcess_RPM,",",".")).Item(0).submatches(0)
RPM = CDbl(regex.Execute(oCell_OUTProcess_RPM).Item(0).submatches(0))
Dim i,d,oABCGas_XLS_Stage
For i = asc("B") To Asc("G") ' PARA CADA ETAPA:
d = Chr (i)
c = 63
If Trim(oXlSheet.range (d & c).Value) = "" Then Exit For ' COMPRUEBO SI LA CELDA DE ETAPA NO ESTÁ EN BLANCO -> GENERA UN CILINDRO
Set oABCGas_XLS_Stage = New cABCGas_XLS_Stage
With oABCGas_XLS_Stage
Set .oCell_Stage_CilsDiam = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_Flow = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_Pout = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_Taspirac = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_Tescape = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_TescapeAdiab = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_CompRatio = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_ComprStress = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_TensStress = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_VolumeGen = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_NuVolum = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_FillCoef = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_DeadVolume = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_MinVolum = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_ValveSection = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_ValveSpeed = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_NuValve = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_GammaAdiabIdx = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_DiagrPower = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_Regulation = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_CoolingWater = oXlSheet.range (d & c) : c = c + 1
c = 86
Set .oCell_Stage_NrCoolers = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_CoolerSize = oXlSheet.range (d & c) : c = c + 1 ' ES UN TEXTO...
Set .oCell_Stage_TLR = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_Pdrop = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_WaterFlow = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_CondensateWaterFlow = oXlSheet.range (d & c) : c = c + 1
c = 93
Set .oCell_Stage_Gas_Zin = oXlSheet.range (d & c) : c = c + 1
Set .oCell_Stage_Gas_Zout = oXlSheet.range (d & c) : c = c + 1
'ncils = ncils + Split (.oCell_Stage_CilsDiam," x ")(0) * 1
' en el excel se reflejan LAS ETAPAS, no los cilindros: hay DOS etapas en 1 tandem --> 0.5 cils por etapa tandem
If InStr (UCase(.oCell_Stage_CilsDiam),"T") > 0 Then
ncils = ncils + 0.5 * .numCils
Else
ncils = ncils + .numCils * 1
End If
End With
oDicStages.Add oDicStages.Count, oABCGas_XLS_Stage
Next
Set getGASSheetInfo = oXlSheet
Set oGASXSLSheet_ = getGASSheetInfo
End Function
Private strGasType_
Function strGasType
If Not IsEmpty (strGasType_) Then strGasType = strGasType_ : Exit Function
Dim oCellGasName,strGasName
Dim bPyroGas,bOffGas,bBioGas,bGN,bSynGas,bCoalGas,bCoke,bLPG,bHrich,bHeavyOil, bAcid, bNitrous,bCO2Low,bPlastics_LowTemp,bWet
Dim bReforming_AirBlown,bCathalHidrogen
bPyroGas = True : bBioGas = True : bGN = True : bSynGas = True : bCoalGas = True : bCoke = True : bLPG = True : bHrich = True : bHeavyOil = True : bOffGas = True
bWet = False : bAcid = False : bNitrous = False : bCO2Low = False : bPlastics_LowTemp = False
For Each oCellGasName In oDicGasComp
strGasName = getGasName(oCellGasName)
If InStr(strGasName,"Air") > 0 Then strGasType = "Air"
If getGasComp(oCellGasName) > 95 Then strGasType = strGasName
' el syngas, tb se conoce como coal gas, o coke
' los gases de combustión de carbón contienen SOx y NOx , mientras que los gases de combustión de gas natural normalmente solo contienen NOx .
Select Case strGasName
Case "C3H8"
bGN = bGN And getGasComp(oCellGasName) < 25
bSynGas = bSynGas And getGasComp(oCellGasName) < 10
bLPG = bLPG And getGasComp(oCellGasName) > 30 ' ES EL COMPONENTE CARACTERISTICO DEL LPG
bHeavyOil = bHeavyOil And getGasComp(oCellGasName) < 5
bPyroGas = bPyroGas And getGasComp(oCellGasName) < 10
Case "C2H6"
bGN = bGN And getGasComp(oCellGasName) > 1 And getGasComp(oCellGasName) < 25
bSynGas = bSynGas And getGasComp(oCellGasName) < 10
bLPG = bLPG And getGasComp(oCellGasName) > 30 ' ES EL COMPONENTE CARACTERISTICO DEL LPG
bHeavyOil = bHeavyOil And getGasComp(oCellGasName) < 8
bPyroGas = bPyroGas And getGasComp(oCellGasName) > 1 And getGasComp(oCellGasName) < 20 ' ; ES EL COMPONENTE MAS REPRESENTATIVO DE LA PIROLISIS; RARO QUE ALCANCE EL 20%, MAS BIEN DEBERIA SER < 10%...
bPlastics_LowTemp = getGasComp(oCellGasName) > 10 '; ES EL % CARACTERISTICO PARA EL PROCESADO PIROLITICO DE CIERTOS PLASTICOS (PE) A BAJA TEMPERATURA
Case "CH4"
bBioGas = bBioGas And getGasComp(oCellGasName) > 50 And getGasComp(oCellGasName) < 75 ' ES EL COMPONENTE CARACTERISTICO
bGN = bGN And getGasComp(oCellGasName) > 75
bSynGas = bSynGas And getGasComp(oCellGasName) < 10
bCoalGas = bCoalGas And getGasComp(oCellGasName) < 15 ' EN ALGUN SITIO PONE Q < 2%
bCoke = bCoke And getGasComp(oCellGasName) < 35 ' generalmente incluso un 35%
bLPG = bLPG And getGasComp(oCellGasName) < 20
bHeavyOil = bHeavyOil And getGasComp(oCellGasName) < 35 And getGasComp(oCellGasName) > 25
bPyroGas = bPyroGas And getGasComp(oCellGasName) > 20 And getGasComp(oCellGasName) < 60 ' LO NORMAL ES QUE SEA < 45, SI ES SUPERIOR, PODRÍA CONSIDERARSE "SINTETICO"...
bOffGas = bOffGas And getGasComp(oCellGasName) < 10
Case "CO2"
bBioGas = bBioGas And getGasComp(oCellGasName) > 25 And getGasComp(oCellGasName) < 45 ' ES EL COMPONENTE CARACTERISTICO
bGN = bGN And getGasComp(oCellGasName) < 20
'bSynGas = bSynGas And getGasComp(oCellGasName) > 5 And getGasComp(oCellGasName) < 15
bSynGas = bSynGas And getGasComp(oCellGasName) < 25 And getGasComp(oCellGasName) > 5 ' en gral alrededor del 15%,
bLPG = bLPG And getGasComp(oCellGasName) < 5
bHeavyOil = bHeavyOil And getGasComp(oCellGasName) > 50
bOffGas = bOffGas And getGasComp(oCellGasName) > 30 And getGasComp(oCellGasName) < 75
bCO2Low = bCO2Low And getGasComp(oCellGasName) < 5
bAcid = getGasComp(oCellGasName) > 2.5 ' generalmente un 2% o mas
Case "H2"
bBioGas = bBioGas And getGasComp(oCellGasName) < 5
bGN = bGN And getGasComp(oCellGasName) < 20
bSynGas = bSynGas And getGasComp(oCellGasName) > 25 ' generalmente incluso un 25%, o 30%
bHrich = getGasComp(oCellGasName) > 65
bReforming_AirBlown = getGasComp(oCellGasName) < 40
bCoalGas = bCoalGas And getGasComp(oCellGasName) > 40 ' And getGasComp(oCellGasName) < 50
bCoke = bCoke And getGasComp(oCellGasName) > 40 ' generalmente incluso un 45%
bLPG = bLPG And getGasComp(oCellGasName) < 10
bPyroGas = bPyroGas And getGasComp(oCellGasName) < 40 And getGasComp(oCellGasName) > 20
bOffGas = bOffGas And getGasComp(oCellGasName) > 5 And getGasComp(oCellGasName) < 40
Case "CO"
bGN = bGN And getGasComp(oCellGasName) < 1
'bSynGas = bSynGas And getGasComp(oCellGasName) > 10
bSynGas = bSynGas And getGasComp(oCellGasName) < 60 And getGasComp(oCellGasName) > 15 ' generalmente ALRED DE UN 40%!! incluso un 20%, o 30 a 60%
bCoalGas = bCoalGas And getGasComp(oCellGasName) < 12 ' generalmente un 8%
bCoke = bCoke And getGasComp(oCellGasName) < 10 ' generalmente un 8%
bPyroGas = bPyroGas And getGasComp(oCellGasName) < 10
bOffGas = bOffGas And getGasComp(oCellGasName) < 10
Case "N2"
bCoalGas = bCoalGas And getGasComp(oCellGasName) > 1 And getGasComp(oCellGasName) < 15 ' generalmente un 5-15%
bCoke = bCoke And getGasComp(oCellGasName) > 1 And getGasComp(oCellGasName) < 10 ' generalmente un 5-8%
bReforming_AirBlown = getGasComp(oCellGasName) < 10
bPyroGas = bPyroGas And getGasComp(oCellGasName) < 15
Case "H2O"
bWet = True
Case "CH4O"
bCathalHidrogen = True
Case "SH2","SO2","HCl"
bAcid = getGasComp(oCellGasName) > 0.001 ' generalmente un 0.0004%; 1% = 10000 ppm
Case "NO","NO2","N2O"
bNitrous = getGasComp(oCellGasName) > 0.00001 ' NO2 es el más agresivo, corrosivo (y toxico)
End Select
Next
'Stop
If bBioGas + bGN + bSynGas + bCoalGas + bCoke + bLPG + bHeavyOil + bPyroGas = -1 Or bOffGas Then
Select Case True
Case strGasType <> ""
Case bSynGas
strGasType = "SYNGAS"
If bOffGas Then
If InStr (LCase(oCellProyecto.Value),"off-gas") >0 Or InStr (LCase(oCellObservaciones.Value),"off-gas") >0 _
Or InStr (LCase(oCellProyecto.Value),"offgas") >0 Or InStr (LCase(oCellObservaciones.Value),"offgas") >0 _
Or InStr (LCase(oCellProyecto.Value),"recircul") >0 Or InStr (LCase(oCellObservaciones.Value),"recircul") >0 _
Or InStr (LCase(oCellProyecto.Value),"recycle") >0 Or InStr (LCase(oCellObservaciones.Value),"recycle") >0 _
Or InStr (LCase(oCellProyecto.Value),"flash") >0 Or InStr (LCase(oCellObservaciones.Value),"flash") >0 _
Then
strGasType = "OFF-GAS"
ElseIf MsgBox ("Es compresor PRINCIPAL (SYNGAS; SI) O DE RECIRCULACION (OFF-GAS; NO)?",4+32) <> 6 Then
strGasType = "OFF-GAS"
End If
End If
If bHrich Then strGasType = strGasType & ", H2 RICH" End If
If strGasType = "SYNGAS" then
If bReforming_AirBlown Then strGasType = strGasType & " (REFORMING)" Else strGasType = strGasType & " (AIR BLOWN)" End If
If bCathalHidrogen Then
If bReforming_AirBlown Then
strGasType = Replace (strGasType,"REFORMING","REFORMING, CATHALYTIC HYDROGENATION CO-CO2")
Else
End if
End if
End if
Case bBioGas : strGasType = "BIOGAS"
Case bHeavyOil : strGasType = "Heavy Oil Associated (EOR) / Unconv. Reservoir"
Case bCoalGas : strGasType = "COAL GAS"
Case bLPG : strGasType = "LPG"
Case bGN : strGasType = "NATURAL GAS"
Case bPyroGas
strGasType = "PYROGAS"
If bOffGas Then
If InStr (LCase(oCellProyecto.Value),"off-gas") >0 Or InStr (LCase(oCellObservaciones.Value),"off-gas") >0 _
Or InStr (LCase(oCellProyecto.Value),"offgas") >0 Or InStr (LCase(oCellObservaciones.Value),"offgas") >0 _
Or InStr (LCase(oCellProyecto.Value),"recircul") >0 Or InStr (LCase(oCellObservaciones.Value),"recircul") >0 _
Or InStr (LCase(oCellProyecto.Value),"recycle") >0 Or InStr (LCase(oCellObservaciones.Value),"recycle") >0 _
Or InStr (LCase(oCellProyecto.Value),"flash") >0 Or InStr (LCase(oCellObservaciones.Value),"flash") >0 _
Then
strGasType = "OFF-GAS"
ElseIf MsgBox ("Es compresor PRINCIPAL (PYROGAS; SI) O DE RECIRCULACION (OFF-GAS; NO)?",4+32) <> 6 Then
strGasType = "OFF-GAS"
End If
End If
If bCO2Low Then strGasType = strGasType & " (condensed CO2)"
If bPlastics_LowTemp Then strGasType = strGasType & " (plastics, low residence, low temp)"
Case bOffGas
strGasType = "OFF-GAS"
End Select
If bWet Then strGasType = strGasType & " (wet)"
If bAcid Then strGasType = strGasType & " (acid gas)"
If strGasType <> "" Then MsgLog ("El gas a procesar se puede considerar un " & strGasType)
ElseIf strGasType = "" Then
' no se sabe
MsgIE "No se ha identificado el tipo de gas según composicion. (PTE perfeccionar funcion strGasType)"
strGasType = "gas comp. acc. to data sheet"
End If
strGasType_ = strGasType
End Function
Private bNACE_Corrosivo_
Public Function bNACE_Corrosivo
If Not IsEmpty (bNACE_Corrosivo_) Then bNACE_Corrosivo = bNACE_Corrosivo_ : Exit Function
' sI ES nace HAY QUE PONER: 1. bloque SAS; 2. Panel de N2; 3. Empaquetaduras en AISI 316; 4. Segmentos especiales (T92 / CO2); 5. Vástago con recubrim WC; 6. Calderería en INOX!!
If fso.FileExists (strNACEcheckFPath) Then
Dim regex
Set regex = New RegExp
regex.Global = True : regex.IgnoreCase = True : regex.multiline = False
Dim oXlSheet, c, oCellGasName,bExcelScreenUpdating
On Error Resume Next ' Si hay errores en Excel, que continúe
Dim naceFMFile
Set naceFMFile = m_ExcelApp.OpenFile(strNACEcheckFPath, True, True)
If Not (naceFMFile Is Nothing) Then
bExcelScreenUpdating = objExcel.ScreenUpdating
If bQuickExcel Then objExcel.ScreenUpdating = False
Set oXlSheet = naceFMFile.Workbook.worksheets("Presión parcial")
' P absoluta (max), = Psalida
oXlSheet.range ("D1").Value = oDicStages.Item(oDicStages.Count-1).Stage_Pout / 10
' Temp gas (max), salida 1A ETAPA!!!
oXlSheet.range ("F1").Value = oDicStages.Item(0).oCell_Stage_Tescape
For c = 4 To 15
oXlSheet.range ("D" & c).Value = 0
For Each oCellGasName In oDicGasComp
regex.Pattern ="\b" & Replace(getGasName(oCellGasName),"SH2","H2S") & "$"
'If regex.Test(oXlSheet.range ("C" & c).Value) Then oXlSheet.range ("D" & c).Value = Replace(getGasComp(oCellGasName),".",",") : Exit For
If regex.Test(oXlSheet.range ("C" & c).Value) Then oXlSheet.range ("D" & c).Value = CDbl(getGasComp(oCellGasName)) : Exit For
Next
Next
' Ya tenemos el valor de salida:
MsgIE ("NACE de los gases procesados: " & oXlSheet.range ("J22").Value)
bNACE_Corrosivo = (oXlSheet.range ("J22").Value > 0)
m_ExcelApp.CloseFile naceFMFile.FilePath, False
If bQuickExcel Then objExcel.ScreenUpdating = bExcelScreenUpdating
End If
If Err Then Call MsgLog ("No se ha podido verificar NACE!")
On Error Goto 0
End If
Dim PParc, strGasName
For Each oCellGasName In oDicGasComp
strGasName = getGasName(oCellGasName)
If (strGasName="CO" Or strGasName="SH2") And getGasComp(oCellGasName) > 2 Then bNACE_Corrosivo = True : Exit For
If strGasName="CO2" And getGasComp(oCellGasName) >= 2 Then
PParc = oDicStages.Item(oDicStages.Count-1).Stage_Pout * getGasComp(oCellGasName) / 100
If PParc > 1.5 And getGasComp(oCellGasName) > 5 Then bNACE_Corrosivo = True : Exit For
End if
Next
bNACE_Corrosivo_ = bNACE_Corrosivo
End Function
Private bCylinderMaterialsProcessed_
Function getCylindersMaterials_Limits()
If Not fso.fileExists (strCylsPreMatcheckFPath) Or bCylinderMaterialsProcessed_ Then Exit Function
Dim strfilterRng
' Presiones POR CILINDRO, desde "C:\abc compressors\INTRANET\OilGas\3_OFERTAS\ADJUNTOS OFERTAS\Datos cilindros 2.xlsx"
Select Case oCell_Compressor_Serie
Case "HA": strfilterRng = "A2:G74"
Case "HG", "HP": strfilterRng = "K5:Q52"
Case Else : strfilterRng = ""
End Select
If strfilterRng = "" Then Exit Function ' El Excel no da información para esta plataforma
On Error Resume Next ' Si hay errores en Excel, que continúe
Dim cylFMFile
Set cylFMFile = m_ExcelApp.OpenFile(strCylsPreMatcheckFPath, True, True)
If (cylFMFile Is Nothing) Then Exit Function ' No se ha podido abrir el Excel con informacion de cilindros
Dim oXlSheet
Set oXlSheet = cylFMFile.Workbook.worksheets("Hoja1")
Call oXlSheet.Range(strfilterRng).Select
Call objExcel.Selection.Replace (" Bar", "", 2, 1, False, False, False)
Stop ' para revisar que se use bien
Dim oDicMatches, cS, oABCGas_XLS_Stage, rFiltered, cval, cilrow, strDescr
cS = 0
For Each oABCGas_XLS_Stage In oDicStages.Items
' Obtiene el material del cilindro de cada etapa, a partir de la hoja de excel; y el LIMITE DE PRESIÓN QUE RESISTE.
cS = cS + 1
Call objExcel.Selection.AutoFilter
oXlSheet.Range(strfilterRng).AutoFilter 1, "=*Ø " & iEtapaDiam(cS) & "*" , 1
'oXlSheet.Range(strfilterRng).AutoFilter 4, ">=" & oABCGas_XLS_Stage.Stage_Pout, 1
Set oDicMatches = CreateObject("scripting.dictionary")
Set rFiltered = oXlSheet.AutoFilter.Range
For Each cilrow In rFiltered.Offset(1).Resize(rFiltered.Rows.Count - 1).Columns(1).SpecialCells(12) ' solo celdas visibles
strDescr = cilrow.Value
Select Case True
Case InStr (strDescr,"EN-GJL-") > 0 : strDescr = Replace (strDescr,"EN-GJL-","fund. gris " & "EN-GJL-")
Case InStr (strDescr,"EN-GJS-") > 0 : strDescr = Replace (strDescr,"EN-GJS-","fund. nodular " & "EN-GJS-")
Case InStr (strDescr," GGG-") > 0 : strDescr = Replace (strDescr," GGG-"," fund. nodular " & " GGG-")
Case InStr (strDescr," GG-") > 0 : strDescr = Replace (strDescr," GG-"," fund. nodular " & " GG-")
Case InStr (strDescr," F-114") > 0 : strDescr = Replace (strDescr," F-114"," forjado " & " F-114")
End Select
cval = 0
If cilrow.Offset (0,3) >= oABCGas_XLS_Stage.Stage_Pout Then
cval = 3
ElseIf cilrow.Offset (0,3) < oABCGas_XLS_Stage.Stage_Pout And cilrow.Offset (0,4) > oABCGas_XLS_Stage.Stage_Pout Then
strDescr = strDescr & " (¡OJO!: a presión de ensayo en probadero)"
cval = 4
End if
If cval = 0 Then
' cilindro no valido
ElseIf Not oDicMatches.Exists (strDescr) Then
oDicMatches.Add strDescr, cilrow.Offset (0,3)
ElseIf oDicMatches(strDescr).Value < cilrow.Offset (0,3).Value Then
Set oDicMatches(strDescr) = cilrow.Offset (0,3)
End if
Next
If oDicMatches.Count > 0 Then
cval = Empty
For Each strDescr In oDicMatches.Keys
Select Case True
Case cval = Empty, oDicMatches(strDescr).Value < oDicMatches(cval).Value : cval = strDescr
End Select
Next
' El cilindro de la etapa CASA CON ALGUNO DE LA TABLA DE EXCEL, y podría fabricarse COMO CILINDRO ESTANDAR
Stop ' COMPRUEBA QUE SE ASIGNAN BIEN LOS VALORES SIGUIENTES!!!
oABCGas_XLS_Stage.cilMaterial = cval
oABCGas_XLS_Stage.cilPressureLimit = oDicMatches(cval).Value
Else
' NO se ha encontrado ningún cilindro de dimensiones estándar, que aguante la presión de la etapa
' --> habría que fabricar el cilindro A MEDIDA
oABCGas_XLS_Stage.cilMaterial = "a medida (posiblemente forjado)"
'oABCGas_XLS_Stage.cilPressureLimit = Empty
End If
Next
m_ExcelApp.CloseFile cylFMFile.FilePath, False
If Err Then Call MsgLog ("No se ha podido hacer la selección de cilindros, por presiones / materiales!")
On Error Goto 0
bCylinderMaterialsProcessed_ = True
End Function
Public Function bEtapaIsTandem(iEtapa) ' iEtapa es un indice que COMIENZA EN UNO!!!
bEtapaIsTandem = oDicStages.Item(iEtapa-1).bTandem
End Function
Public Function iEtapaDiam(iEtapa) ' iEtapa es un indice que COMIENZA EN UNO!!!
iEtapaDiam = oDicStages.Item(iEtapa-1).diamCils
End Function
Public Function iEtapaNCils(iEtapa) ' iEtapa es un indice que COMIENZA EN UNO!!!
iEtapaNCils = oDicStages.Item(iEtapa-1).numCils
End Function
Public Function bEtapaReqForjado(iEtapa) ' iEtapa es un indice que COMIENZA EN UNO!!!
bEtapaReqForjado = oDicStages.Item(iEtapa-1).Stage_Pout > 80
' en el caso de H2 / ATEX... SE PONEN FORJADOS INCLUSO DESDE MAS ABAJO:
bEtapaReqForjado = bEtapaReqForjado Or (bATEX_Inflamable And oDicStages.Item(iEtapa-1).Stage_Pout > 80 * 0.85)
' ESTO ES FALSO!!!: si la plataforma es HP o HX, SIEMPRE van forjados (los cilindros PUEDE QUE NO!!, si acaso, bielas, etc!!!)
' bEtapaReqForjado = bEtapaReqForjado Or (oCell_Compressor_Serie = "HP" Or oCell_Compressor_Serie = "HX")
' si el diam es menor de 75 tb van forjados, NO se pueden hacer en fundic nodular
bEtapaReqForjado = bEtapaReqForjado Or oDicStages.Item(iEtapa-1).diamCils <= 75
' compresores HP o HX, DE DIAMETROS GRANDES, Y A ALTAS PRESIONES (ya incluso inferiores a 80 bar)... convendría que fuesen encamisados
' (se hace en fundicion nodular o acero fundido el cuerpo, y el liner añade proteccion)
bEtapaReqForjado = bEtapaReqForjado Or (oDicStages.Item(iEtapa-1).diamCils >= 450 _
And oDicStages.Item(iEtapa-1).Stage_Pout > 65)
End Function
Public Function bEtapaConvieneCamisa(iEtapa) ' iEtapa es un indice que COMIENZA EN UNO!!!
bEtapaConvieneCamisa = oDicStages.Item(iEtapa-1).Stage_Pout > 80
' ESTO ES FALSO!!!: si la plataforma es HP o HX, SIEMPRE van forjados (los cilindros PUEDE QUE NO!!, si acaso, bielas, etc!!!)
' bEtapaReqForjado = bEtapaReqForjado Or (oCell_Compressor_Serie = "HP" Or oCell_Compressor_Serie = "HX")
' si el diam es menor de 75 tb van forjados, NO se pueden hacer en fundic nodular
bEtapaConvieneCamisa = bEtapaConvieneCamisa Or oDicStages.Item(iEtapa-1).diamCils <= 75
End Function
Private strModelName_
Function strModelName
If Not IsEmpty (strModelName_) Then strModelName = strModelName_ : Exit Function
Dim strCils, oABCGas_XLS_Stage, nEtapa
On Error Resume Next
For Each oABCGas_XLS_Stage In oDicStages.Items
nEtapa = nEtapa + 1
strCils = strCils & "-" & oABCGas_XLS_Stage.numCils & "x" & oABCGas_XLS_Stage.diamCils
If oABCGas_XLS_Stage.bTandem Then strCils = strCils & "T"
If bEtapaReqForjado(nEtapa) Then
strCils = strCils & "FC"
ElseIf bNACE_Corrosivo Then
' en gases corrosivos, la camisa protege el cuerpo del cilindro. API 618 practicamente LO EXIGE en caso de NACE
strCils = strCils & "C"
ElseIf bEtapaConvieneCamisa(nEtapa) Then
strCils = strCils & "(C)"
End If
Next
strModelName = oDicStages.Count
If InStr (UCase(strCils),"T") > 0 Then strModelName = strModelName & "T"
strModelName = strModelName & "E" & oCell_Compressor_Serie & "-" & ncils & "-"
If bATEX_Inflamable Then strModelName = strModelName & "L"
If bAire Then
strModelName = strModelName & "LT" & strCils
Else
strModelName = strModelName & "GT" & strCils
End If
If bNACE_Corrosivo Then strModelName = strModelName & " NACE"
If bATEX_Inflamable Then
strModelName = strModelName & " ATEX" : MsgBox ("poner TODO para ATEX: distanciador tipo C - bloque SAS; panel de purga de N2 + venting; valvula bicera en carter (ATEX), y motor ATEX, etc; zonificando paneles")
ElseIf bSafeZone Then
' tiene H2; pero dependiendo del PM de la mezcla... Si < 12, **FULL ATEX**, distanciador, motor, etc; si > 12, (ATEX) : solo MOTOR; y se haria clasificacion de zona
strModelName = strModelName & " (ATEX)" : MsgBox ("poner valvula bicera en carter (ATEX), y motor ATEX, zonificando paneles")
End If
strModelName_ = strModelName
If Err Then Call MsgLog ("No se ha podido determinar el modelo del compresor!")
On Error Goto 0
End Function
Private Function fixStringFN (str)
fixStringFN = Replace (str,";","-")
fixStringFN = Replace (fixStringFN,"|","-")
regex.Pattern = "\-*[\<\>\*\!\?\/:]"
fixStringFN = regex.Replace(fixStringFN,"-")
End Function
Public Function getABCFileName (revisionNr)
' revisionNr indica LA OPCION DE CALCULO QUE ESTA REVISARÍA!!! (NO es un 'orden' 01-02-03... de numero de revision, OJO!!!)
Dim regex,match,strFType,strExt
Set regex = New RegExp
regex.Global = True : regex.IgnoreCase = True : regex.multiline = False
' en lo siguiente SIEMPRE debería ser calc, al menos de momento: en ESTA CLASE aún no se procesan el resto de ficheros!!!
regex.Pattern = "(?:ABC_(Gas_Cooler|Aircooler|Reducer|Main Motor|Instrumentation|Gas_Filter|Frequency Converter|Cooling Water Pump|Dryer|Piston_rider_ring_selection|Cooling Water Tower|" & _
"Pressure_Safety_Valve|Valves_selection)\-|.*?curv.*?)?([A-Z]{3}\d{5}_\d{2})(_calc(?:_multi)?|.*?curv.*?)?.*?(_old\(\d+\))?(\.(?:xlsx|rtf))$"
On Error Resume Next
For Each match in regex.Execute (strXLSXPath)
If oCellCalculo.Value <> match.submatches (1) Then MsgBox ("El cálculo NO corresponde con el nombre del fichero!!") : Stop
If match.submatches(0) = "" Then
strFType = match.submatches(2)
Else
strFType = "_" & match.submatches(0)
End If
If strFType = "" And InStr (LCase(fso.getfileName(strXLSXPath)),"curv") > 0 Then
MsgBox ("Fichero pendiente de procesar: curvas de funcionamiento")
Stop ' INTERESA PROCESAR TB LOS FICHEROS DE CURVAS DE funcionamiento!!!, seria bueno SACAR DE ELLAS EL RENDIMIENTO, Y LAS CURVAS DE SENSIBILIDAD a temperatura, presion, etc...
strFType = "working curves"
End If
strExt = match.submatches (4)
If match.submatches (3) <> "" Then
'Stop ' tiene en cuenta versiones obsoletas
'getABCFileName = Left (getABCFileName,Len(getABCFileName)-Len(strExt)) & match.submatches (3) & strExt
strExt = match.submatches (3) & strExt
End If
Next
If Err Then Call MsgLog ("No se ha podido generar un nombre para el fichero!") : Exit Function
On Error Goto 0
getABCFileName = fso.GetParentFolderName (strXLSXPath) & "\" & oCellCalculo.Value & strFType & strExt
If False And oCellFecha.Value <> "" Then
strFecha = Split (oCellFecha.Value,"/")(2) & "-" & Split (oCellFecha.Value,"/")(1) & "-" & Split (oCellFecha.Value,"/")(0)
getABCFileName = Replace(getABCFileName,strExt,"_" & strFecha & strExt)
End If
' el MODELO de máquina que resulta del cálculo
getABCFileName = Replace(getABCFileName,strExt,"_" & strModelName & strExt)
MsgIE ("<font color=blue>DEBE aparecer en el nombre del calculo, un <u><b>IDENTIFICADOR DEL 'PROYECTO / COMPRESOR (del 'ITEM')'</b></u>, tal y como lo pide el cliente!! (puede haber varios calculos con resultados diferentes para un mismo proyecto...)</font>")
'getABCFileName = Replace(getABCFileName,strExt,"_" & fixStringFN (oCellCliente.value) & strExt)
'getABCFileName = Replace(getABCFileName,strExt,"_" & fixStringFN (oCellProyecto.value) & strExt)
On Error Resume Next
If oCellObservaciones.Value <> "" Then
' este campo debería tener info SOLO PARA DIFERENCIAR LOS CALCULOS, la razón de los mismos:
' - CONDICIONES OPERATIVAS
' - DISPARO VALVULA SEGURIDAD
' - CONDICIONES DISEÑO
' ...
regex.Pattern = "(?:cond[\.\S]*\s+(?:operat|nominal)|disp[\.\S]*\s+valv[\.\S]*\s+seg|cond[\.\S]*\s+(?:dise|operat|nominal)[\.\S]*\s+cond|safety\s+valve\s+trig|des\.?(?:ign)?\s+cond|dim[\.\S]*\s+motor|pow[\.\S]*\s+siz)[\.\S]*"
If regex.Test (oCellObservaciones.value) Then
getABCFileName = Replace(getABCFileName,strExt,"_" & regex.Execute(oCellObservaciones.value).Item(0).Value & strExt)
Else
MsgIE ("<font color=blue>" & "el campo de OBSERVACIONES en gas_vbnet debería tener info SOLO PARA DIFERENCIAR LOS CALCULOS, la razón de los mismos:" & vbCr & _
"- CONDICIONES OPERATIVAS" & vbCr & "- DISPARO VALVULA SEGURIDAD" & vbCr & "- CONDICIONES DE DISEÑO" & vbCr & "..." & "</font>")
If oCellProyecto.value <> "" Then
getABCFileName = Replace(getABCFileName,strExt,"_" & Left(Trim(fixStringFN (Replace(Replace(Replace(UCase(oCellProyecto.value),"PROJECT",""),"PROYECTO",""),"",""))),30) & strExt)
ElseIf oCellObservaciones.value <> "" Then
getABCFileName = Replace(getABCFileName,strExt,"_" & oCellObservaciones.value & strExt)
End if
End if
regex.Pattern = "rev[\._ \-]*(?:isi[oó]n)?(?:\s*de)?(?:[_ \-]*opc[\. ]*(?:i[oó]n)?(?:(?:[\.\s]*de)?\s*c[áa]lc[\.\s]*(?:ulo)?)?)?[\._ \-]*(\d+)"
If regex.Test (oCellObservaciones.value) Then
Stop ' ESTO HAY QUE SACARLO A cOp_CalcsTecn
Set match = regex.Execute(oCellObservaciones.value).item(0)
If MsgBox ("Detectada una revisión de otra opción de cálculo:" & vbCr & fso.getfilename (strXLSXPath) & vbcr & "¿es la revisión de la opción de cálculo " & _
match.Submatches(0) & " ?",4) = 6 Then
revisionNr = match.Submatches(0) : stop
End If
End If
regex.Pattern = "descartado|discarded"
If regex.Test (oCellObservaciones.value) Then
MsgBox ("el campo de OBSERVACIONES en gas_vbnet indica que este cálculo, " & fso.getfilename (strXLSXPath) & _
" se ha DESCARTADO. Se remarca en el nombre de fichero.")
Stop ' asegurarse de que en el nombre de fichero aparece el término DESCARTADO / DISCARDED
End If
End If
If Err Then Call MsgLog ("No se ha podido generar un nombre para el fichero!") : Exit Function
On Error Goto 0
If Not IsEmpty (revisionNr) Then
Stop ' PTE DE IMPLEMENTAR
getABCFileName = Replace(getABCFileName,oCellCalculo.Value & strFType,oCellCalculo.Value & strFType & "_rev " & revisionNr)
End If
getABCFileName = fso.GetParentFolderName (getABCFileName) & "\" & fixStringFN (fso.GetFileName(getABCFileName))
If Len (getABCFileName) > 254 Then
getABCFileName = Left(Replace(getABCFileName,strExt,""),254-Len(strExt)) & strExt
End If
End Function
Private Function ReplaceInAllCells (Range,strfrom,strto, ByRef bSave)
If Range is Nothing THen Exit Function
Dim oCell, strPrevCellAddress
' Busqueda parcial, xlPart = 2, en xlValues = , -4163
'Set oCell = Range.Find(strfrom,Range.Application.ActiveCell,-4163,2)
' la siguiente es para CASE SENSITIVE, por si acaso
Set oCell = Range.Find(strfrom,Range.Application.ActiveCell,-4163,2,1,1,True,False)
If Not oCell is Nothing Then
bSave = True
Do Until oCell Is Nothing
If strPrevCellAddress = oCell.Address Then Exit Do
oCell.Value = Replace(oCell.Value,strfrom,strto)
strPrevCellAddress = oCell.Address
Set oCell = Range.FindNext(oCell)
Loop
End if
End Function
Private oGASINGXSLSheet_Fixed_
Public Function fixCGASING()
If Not IsEmpty (oGASINGXSLSheet_Fixed_) Then
Set fixCGASING = oGASINGXSLSheet_Fixed_
Exit Function ' SOLO SE PROCESA UNA VEZ esta función: la info que lee NO CAMBIA, --> NO tiene sentido hacerlo más veces
End If
If m_ExcelFMFile Is Nothing Then Exit Function
If Not m_ExcelFMFile.HasWorksheet("C-GAS-ING") Then
Exit Function
End If
' cambia algunas cadenas de texto a ingles en C-GAS-ING
Dim oXlSheet,oCell,c,d,vtmp,bExcelScreenUpdating
Set oXlSheet = m_ExcelFMFile.GetWorksheet("C-GAS-ING")
bExcelScreenUpdating = objExcel.ScreenUpdating
If bQuickExcel Then objExcel.ScreenUpdating = False
oXlSheet.Activate
objExcel.ActiveWindow.Zoom = 100
oXlSheet.Range("A1").Select
Call ReplaceInAllCells (oXlSheet.Cells,"Vapor de agua","Water vapor",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Agua","Water",bSave)
' Busqueda parcial, xlPart = 2, en xlValues = , -4163
Call ReplaceInAllCells (oXlSheet.Cells,"Límite RPM","RPM Limit",bSave)
Call ReplaceInAllCells (oXlSheet.Cells," / 0 ( 0 )","",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Seco-LT","Dry-LT",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"o Dry-LT","or Dry-LT",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Atmosférico (Normal)","Atmospheric (Standard)",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Metros","Meters",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Composición del gas en Volumen :","Gas composition by volume :",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Aire seco","Dry air",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Aire","Air",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Monóxido de Carbono","Carbon monoxide",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Anhídrido Carbónico, Dióxido de Carbono","Carbon dioxide",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Acido Sulfhídrico, Sulfuro de Hidrógeno","Hydrogen sulfide",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Nitrógeno","Nitrogen",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Hidrógeno","Hydrogen",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Oxígeno","Oxygen",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Metano","Methane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Etano","Ethane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Propano","Propane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells, "propano", "propane", bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Etileno, Eteno","Ethylene, Ethene",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Argón","Argon",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Propileno, Propeno","Propylene, Propene",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Butano","Buthane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"butano","buthane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Metil","Methyl",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"metil","methyl",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Amoníaco","Ammonia",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Pentano","Penthane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"pentano","penthane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Hexano","Hexane",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Autor :","Author :",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"Fecha :","Date :",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"- Pressure ","- Exhaust pressure ",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"CV/KW","HP/kW",bSave)
Call ReplaceInAllCells (oXlSheet.Cells," CV"," HP",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,"-Amount and Diameter :","- Amount and diameter:",bSave)
Call ReplaceInAllCells (oXlSheet.Cells,Wshshell.ExpandEnvironmentStrings("%username%"),objExcel.Application.UserName,bSave)
Set oCell = oXlSheet.Cells.Find("CH4O : ",oXlSheet.Cells.Application.ActiveCell,-4163,2,1,1,True,False)
If Not oCell is Nothing Then if oCell.Offset(0, 2).Value <> "Methanol" Then oCell.Offset(0, 2).Value = "Methanol" : bSave = True
Set oCell = oXlSheet.Cells.Find("Total mechanical losses : ",oXlSheet.Cells.Application.ActiveCell,-4163,2,1,1,True,False)
regex.Pattern = "([\d,]+) HP"
If Not oCell is Nothing Then
If InStr (UCase(oCell.Offset(0, 1).Value)," HP/KW") = 0 then
c = regex.Execute(oCell.Offset(0, 1).Value).Item(0).Submatches(0) * 1
oCell.Offset(0, 1).Value = Round(c, 2) & " / " & Round(c * 0.7457,2) & " HP/kW"
bSave = True
End if
End If
regex.Pattern = "\s*:\s*"
For Each oCell In oXlSheet.Range("F19:F29")
oCell.value = regex.Replace(oCell.value, "")
Next
MsgLog vbtab & "Corregidos errores de idioma y texto en C-GAS-ING"
Set oCell = oXlSheet.Cells.Find("Compressor model : ",oXlSheet.Cells.Application.ActiveCell,-4163,2,1,1,True,False)
regex.Pattern = "^(.+?)\-\d+x"
If Not oCell is Nothing Then oCell.Offset(0, 1).Value = regex.Execute(strModelName).Item(0).Submatches(0)
' mostrar celdas ocultas, para eliminarlas
If oXlSheet.Range("A60:A60").Value <> "" then
oXlSheet.Rows("1:100").Select
oXlSheet.Application.Selection.EntireRow.Hidden = False
If oXlSheet.Cells.Find("Motor at max. : ") Is Nothing Or oXlSheet.Cells.Find("Isothermal efficiency : ") Is Nothing Then
'Stop
else
'xlShiftUp = -4162' CÓMO SE DESPLAZAN LAS CELDAS PARA SUSTITUIR A LAS ELIMINADAS
oXlSheet.Rows("52:53").Delete
oXlSheet.Rows("53:55").Delete
oXlSheet.Rows("63:64").Delete
oXlSheet.Rows("64:87").Delete
oXlSheet.Rows("39:39").Delete
MsgLog vbtab & "Eliminadas filas ocultas en C-GAS-ING"
End If
bSave = True
End If
If oXlSheet.Range("E45:E45").Value <> "" Then
' EL FLOW DRY / WET
' xlDown, -4121 (inserta desplazando filas hacia abajo); xlFormatFromLeftOrAbove = 0 (el formato de las celdas insertadas es el de las de encima)