CAD/CAM discussion forum > Other CAD/CAM Technology > Runtime Error 13 Type mismatch

Runtime Error 13 Type mismatch

    
  Subscribe Topic

Rank: 1

Ariel B. Serrano

Newbie

posts: 0

Registered: 2010-7-17

Message 1 of 1

 Runtime Error 13 Type mismatch
12-07-2010 08:22 . am   |   View his/her posts only
Hello all, gud day to you guys,

Hi I am new in VBA & ZWCAD, i have a vba program that is running fine to AutoCAD, but when i run it to ZWCAD and have some modification for ZWCAD the program got an error: Runtime Error 13 Type Mistmatch. here is the code:

Option Explicit
Public Tatts As Variant
Public ssnew As Object
'declare global variables

Private Sub CommandButton1_Click()

UpdateAttrib 0, UserForm1.ComboBox1.Text
UpdateAttrib 1, UserForm1.ComboBox2.Text
UpdateAttrib 2, UserForm1.ComboBox3.Text
UpdateAttrib 3, UserForm1.ComboBox4.Text
UpdateAttrib 4, UserForm1.ComboBox5.Text
UpdateAttrib 5, UserForm1.ComboBox6.Text
UpdateAttrib 6, UserForm1.ComboBox7.Text
UpdateAttrib 7, UserForm1.ComboBox8.Text
UpdateAttrib 8, UserForm1.ComboBox9.Text
UpdateAttrib 9, UserForm1.ComboBox10.Text
UpdateAttrib 10, UserForm1.ComboBox11.Text
UpdateAttrib 11, UserForm1.ComboBox12.Text
UpdateAttrib 12, UserForm1.ComboBox13.Text
UpdateAttrib 13, UserForm1.ComboBox14.Text
UpdateAttrib 14, UserForm1.ComboBox15.Text
UpdateAttrib 15, UserForm1.TextBox15.Text
UpdateAttrib 16, UserForm1.TextBox14.Text
UpdateAttrib 17, UserForm1.TextBox13.Text
UpdateAttrib 18, UserForm1.TextBox12.Text
UpdateAttrib 19, UserForm1.TextBox11.Text
UpdateAttrib 20, UserForm1.TextBox10.Text
UpdateAttrib 21, UserForm1.TextBox9.Text
UpdateAttrib 22, UserForm1.TextBox8.Text
UpdateAttrib 23, UserForm1.TextBox7.Text
UpdateAttrib 24, UserForm1.TextBox6.Text
UpdateAttrib 25, UserForm1.TextBox5.Text
UpdateAttrib 26, UserForm1.TextBox4.Text
UpdateAttrib 27, UserForm1.TextBox3.Text
UpdateAttrib 28, UserForm1.TextBox2.Text
UpdateAttrib 29, UserForm1.TextBox1.Text
UpdateAttrib 30, UserForm1.TextBox47.Text
UpdateAttrib 31, UserForm1.TextBox46.Text
UpdateAttrib 32, UserForm1.TextBox45.Text
UpdateAttrib 33, UserForm1.TextBox44.Text
UpdateAttrib 34, UserForm1.TextBox43.Text
UpdateAttrib 35, UserForm1.TextBox42.Text
UpdateAttrib 36, UserForm1.TextBox41.Text
UpdateAttrib 37, UserForm1.TextBox40.Text
UpdateAttrib 38, UserForm1.TextBox39.Text
UpdateAttrib 39, UserForm1.TextBox38.Text
UpdateAttrib 40, UserForm1.TextBox37.Text
UpdateAttrib 41, UserForm1.TextBox36.Text
UpdateAttrib 42, UserForm1.TextBox35.Text
UpdateAttrib 43, UserForm1.TextBox34.Text
UpdateAttrib 44, UserForm1.TextBox33.Text
UpdateAttrib 45, UserForm1.TextBox32.Text

'get the attribute values

ssnew.Item(0).Update
'update the attribute block

'delete the selection set
ThisDocument.SelectionSets.Item("OWIBLK").Delete


End Sub
Private Sub CommandButton3_Click()
'delete the selection set
'ThisDocument.SelectionSets.Item("OWIBLK").Delete
End
End Sub

Private Sub UserForm_Activate()
UserForm1.ComboBox1.AddItem "AB 3x25x25"
UserForm1.ComboBox1.AddItem "AB 4x25x25"
UserForm1.ComboBox1.AddItem "AB 3x38x38"
UserForm1.ComboBox1.AddItem "AB 5x38x38"
UserForm1.ComboBox1.AddItem "AB 4x50x50"
UserForm1.ComboBox1.AddItem "AB 6x50x50"
UserForm1.ComboBox1.AddItem "AB 6x75x75"
UserForm1.ComboBox1.AddItem "AB 9x75x75"
UserForm1.ComboBox1.AddItem "AB 6x100x100"
UserForm1.ComboBox1.AddItem "AB 8x75x100"
UserForm1.ComboBox1.AddItem "AB 6x65x65"
UserForm1.ComboBox1.AddItem "ANCHOR BOX-50"
UserForm1.ComboBox1.AddItem "ANCHOR BOX-110"
UserForm1.ComboBox1.AddItem "BK-10"
UserForm1.ComboBox1.AddItem "BK-12R"
UserForm1.ComboBox1.AddItem "BS-001/SQ1"
UserForm1.ComboBox1.AddItem "BS-005/SQ2"
UserForm1.ComboBox1.AddItem "BS-007/SQ1"
UserForm1.ComboBox1.AddItem "BS-008"
UserForm1.ComboBox1.AddItem "BS-009"
UserForm1.ComboBox1.AddItem "BS-012"
UserForm1.ComboBox1.AddItem "BS-014/Q2"
UserForm1.ComboBox1.AddItem "BS-015/Q2"
UserForm1.ComboBox1.AddItem "BS-017"
UserForm1.ComboBox1.AddItem "CHERRY BLOSSOM-2"
UserForm1.ComboBox1.AddItem "CHERRY BLOSSOM"
UserForm1.ComboBox1.AddItem "CHERRY BLOSS-s"
UserForm1.ComboBox1.AddItem "CHERRY BLOSS-m"
UserForm1.ComboBox1.AddItem "CHERRY BLOSS-b"
UserForm1.ComboBox1.AddItem "COPPER WIRE 1?"
UserForm1.ComboBox1.AddItem "COPPER WIRE 1.5?"
UserForm1.ComboBox1.AddItem "COPPER WIRE 1.8?"
UserForm1.ComboBox1.AddItem "COPPER SHT 0.1t"
UserForm1.ComboBox1.AddItem "COPPER SHT 0.2t"
UserForm1.ComboBox1.AddItem "COPPER SHT 0.8t"
UserForm1.ComboBox1.AddItem "CHECKERED PL t8"
UserForm1.ComboBox1.AddItem "CHECKERED PL t6"
UserForm1.ComboBox1.AddItem "CHECKERED PL t5"
UserForm1.ComboBox1.AddItem "CHECKERED PL t4"
UserForm1.ComboBox1.AddItem "CHECKERED PL t3"
UserForm1.ComboBox1.AddItem "CRS 12.7"
UserForm1.ComboBox1.AddItem "CRS 22"
UserForm1.ComboBox1.AddItem "CRS 25"
UserForm1.ComboBox1.AddItem "CRS 28.8"
UserForm1.ComboBox1.AddItem "CRS 32"
UserForm1.ComboBox1.AddItem "CRS 35"
UserForm1.ComboBox1.AddItem "CRS 40"
UserForm1.ComboBox1.AddItem "CRS 50"
UserForm1.ComboBox1.AddItem "CRS 60"
UserForm1.ComboBox1.AddItem "CRS 75"
UserForm1.ComboBox1.AddItem "CT-004"
UserForm1.ComboBox1.AddItem "DE-002"
UserForm1.ComboBox1.AddItem "DE-004"
UserForm1.ComboBox1.AddItem "DE-005/A"
UserForm1.ComboBox1.AddItem "DE-009"
UserForm1.ComboBox1.AddItem "DE-010S"
UserForm1.ComboBox1.AddItem "DE-010M"
UserForm1.ComboBox1.AddItem "DE-010B"
UserForm1.ComboBox1.AddItem "DE-013S"
UserForm1.ComboBox1.AddItem "DE-013 SET"
UserForm1.ComboBox1.AddItem "DE-014 SET"
UserForm1.ComboBox1.AddItem "DE-016"
UserForm1.ComboBox1.AddItem "DE-19"
UserForm1.ComboBox1.AddItem "DE-20"
UserForm1.ComboBox1.AddItem "DE-23"
UserForm1.ComboBox1.AddItem "DE-24"
UserForm1.ComboBox1.AddItem "DE-24-L-M"
UserForm1.ComboBox1.AddItem "DE-24-L-L"
UserForm1.ComboBox1.AddItem "DS-2008"
UserForm1.ComboBox1.AddItem "DS-2009"
UserForm1.ComboBox1.AddItem "DS-2014"
UserForm1.ComboBox1.AddItem "DS-2014-60A"
UserForm1.ComboBox1.AddItem "DS-2015"
UserForm1.ComboBox1.AddItem "DS-2051 (F-064)"
UserForm1.ComboBox1.AddItem "DS-2091 (F-014)"
UserForm1.ComboBox1.AddItem "DS-2114"
UserForm1.ComboBox1.AddItem "F-114"
UserForm1.ComboBox1.AddItem "FAB LEAF 039-04"
UserForm1.ComboBox1.AddItem "FAB GRAPE LEAF"
UserForm1.ComboBox1.AddItem "FM-3151"
UserForm1.ComboBox1.AddItem "FM-3152"
UserForm1.ComboBox1.AddItem "FM-3251"
UserForm1.ComboBox1.AddItem "FM-3284"
UserForm1.ComboBox1.AddItem "FM-4104W"
UserForm1.ComboBox1.AddItem "FM-4105W"
UserForm1.ComboBox1.AddItem "FM-5537"
UserForm1.ComboBox1.AddItem "FM-5538"
UserForm1.ComboBox1.AddItem "FM-5539"
UserForm1.ComboBox1.AddItem "FM-5540"
UserForm1.ComboBox1.AddItem "FT-H004 (handle)"
UserForm1.ComboBox1.AddItem "FHD-415"
UserForm1.ComboBox1.AddItem "FB 2x12"
UserForm1.ComboBox1.AddItem "FB 4x12"
UserForm1.ComboBox1.AddItem "FB 6x12"
UserForm1.ComboBox1.AddItem "FB 3x15"
UserForm1.ComboBox1.AddItem "FB 4x15"
UserForm1.ComboBox1.AddItem "FB 6x15"
UserForm1.ComboBox1.AddItem "FB 6x20"
UserForm1.ComboBox1.AddItem "FB 4x25"
UserForm1.ComboBox1.AddItem "FB 5x25"
UserForm1.ComboBox1.AddItem "FB 6x25"
UserForm1.ComboBox1.AddItem "FB 8x25"
UserForm1.ComboBox1.AddItem "FB 12x25"
UserForm1.ComboBox1.AddItem "FB 5x30"
UserForm1.ComboBox1.AddItem "FB 6x30"
UserForm1.ComboBox1.AddItem "FB 8x30"
UserForm1.ComboBox1.AddItem "FB 10x30"
UserForm1.ComboBox1.AddItem "FB 5x40"
UserForm1.ComboBox1.AddItem "FB 8x40"
UserForm1.ComboBox1.AddItem "FB 10x40"
UserForm1.ComboBox1.AddItem "FB 12x40"
UserForm1.ComboBox1.AddItem "FB 5x50"
UserForm1.ComboBox1.AddItem "FB 6X50"
UserForm1.ComboBox1.AddItem "FB 8x50"
UserForm1.ComboBox1.AddItem "FB 12x50"
UserForm1.ComboBox1.AddItem "FB 19 x 50"
UserForm1.ComboBox1.AddItem "FB 20 x 50"
UserForm1.ComboBox1.AddItem "FB 25 x 50"
UserForm1.ComboBox1.AddItem "FB 8x60"
UserForm1.ComboBox1.AddItem "FB 12x60"
UserForm1.ComboBox1.AddItem "FB 4x75"
UserForm1.ComboBox1.AddItem "FB 6x75"
UserForm1.ComboBox1.AddItem "FB 8X75"
UserForm1.ComboBox1.AddItem "FB 11x75"
UserForm1.ComboBox1.AddItem "FB 12X75"
UserForm1.ComboBox1.AddItem "FB 6x100"
UserForm1.ComboBox1.AddItem "GB 1470"
UserForm1.ComboBox1.AddItem "GB1471"
UserForm1.ComboBox1.AddItem "GB 2103"
UserForm1.ComboBox1.AddItem "GB 2104"
UserForm1.ComboBox1.AddItem "GB 2105 / OI"
UserForm1.ComboBox1.AddItem "GB 2106 / OI"
UserForm1.ComboBox1.AddItem "GB 2110"
UserForm1.ComboBox1.AddItem "GEKIDAN GRAPES"
UserForm1.ComboBox1.AddItem "GF CSO120"
UserForm1.ComboBox1.AddItem "GF CSO140"
UserForm1.ComboBox1.AddItem "GF CS200"
UserForm1.ComboBox1.AddItem "GF CSO250"
UserForm1.ComboBox1.AddItem "GB 2424"
UserForm1.ComboBox1.AddItem "GB 2475 W"
UserForm1.ComboBox1.AddItem "GB 2486 W"
UserForm1.ComboBox1.AddItem "GB 2491"
UserForm1.ComboBox1.AddItem "GB 2492"
UserForm1.ComboBox1.AddItem "GI SHEET #20"
UserForm1.ComboBox1.AddItem "GI WIRE #16"
UserForm1.ComboBox1.AddItem "H-BEAM100X100(t8)"
UserForm1.ComboBox1.AddItem "H-BEAM150X250"
UserForm1.ComboBox1.AddItem "H-BEAM 125X125"
UserForm1.ComboBox1.AddItem "H-BEAM 150X150"
UserForm1.ComboBox1.AddItem "H-BEAM 200X200"
UserForm1.ComboBox1.AddItem "HIBISCUS LEAF"
UserForm1.ComboBox1.AddItem "HIBISCUS FLOWER"
UserForm1.ComboBox1.AddItem "MSP t1.0"
UserForm1.ComboBox1.AddItem "MSP t1.5"
UserForm1.ComboBox1.AddItem "MSP t2"
UserForm1.ComboBox1.AddItem "MSP t2.5"
UserForm1.ComboBox1.AddItem "MSP t3"
UserForm1.ComboBox1.AddItem "MSP t4"
UserForm1.ComboBox1.AddItem "MSP t5"
UserForm1.ComboBox1.AddItem "MSP t6"
UserForm1.ComboBox1.AddItem "MSP t8"
UserForm1.ComboBox1.AddItem "MSP t9"
UserForm1.ComboBox1.AddItem "MSP t10"
UserForm1.ComboBox1.AddItem "MSP t12"
UserForm1.ComboBox1.AddItem "MSP t16"
UserForm1.ComboBox1.AddItem "MSP t20"
UserForm1.ComboBox1.AddItem "MSP t25"
UserForm1.ComboBox1.AddItem "MSP t30"
UserForm1.ComboBox1.AddItem "NEWSPRINT PAPER"
UserForm1.ComboBox1.AddItem "OI-EMO HINGES 12"
UserForm1.ComboBox1.AddItem "OI-HINGES 144"
UserForm1.ComboBox1.AddItem "OI-HINGES 30x144"
UserForm1.ComboBox1.AddItem "OI-HINGE 32x191"
UserForm1.ComboBox1.AddItem "OI-HINGE 50x191"
UserForm1.ComboBox1.AddItem "OI-FOOT BOLT/SK"
UserForm1.ComboBox1.AddItem "OI-BARREL & BOLT"
UserForm1.ComboBox1.AddItem "OI-STOPPER"
UserForm1.ComboBox1.AddItem "ONDA LOCK"
UserForm1.ComboBox1.AddItem "OLIVE FRUIT-20"
UserForm1.ComboBox1.AddItem "OLIVE FRUIT-30"
UserForm1.ComboBox1.AddItem "OLIVE FRUIT-40"
UserForm1.ComboBox1.AddItem "OLIVE FRUIT-50"
UserForm1.ComboBox1.AddItem "OLIVE FRUIT-60"
UserForm1.ComboBox1.AddItem "POLY SLAB 10mmt"
UserForm1.ComboBox1.AddItem "POLY SLAB 13mmt"
UserForm1.ComboBox1.AddItem "POLY POST 30mmt"
UserForm1.ComboBox1.AddItem "RB 3"
UserForm1.ComboBox1.AddItem "RB 4"
UserForm1.ComboBox1.AddItem "RB 6"
UserForm1.ComboBox1.AddItem "RB 8"
UserForm1.ComboBox1.AddItem "RB 10"
UserForm1.ComboBox1.AddItem "RB 12"
UserForm1.ComboBox1.AddItem "RB 15.8"
UserForm1.ComboBox1.AddItem "RB 20"
UserForm1.ComboBox1.AddItem "RB 23.5"
UserForm1.ComboBox1.AddItem "RB 25"
UserForm1.ComboBox1.AddItem "ROSETTA"
UserForm1.ComboBox1.AddItem "RT (2t)x19"
UserForm1.ComboBox1.AddItem "RT (2t)x25"
UserForm1.ComboBox1.AddItem "RT (2t)x31.8"
UserForm1.ComboBox1.AddItem "RT 2t X 38.1"
UserForm1.ComboBox1.AddItem "RT 3t X 40.2"
UserForm1.ComboBox1.AddItem "RT (2t) x 50"
UserForm1.ComboBox1.AddItem "RT 3.2 X 60"
UserForm1.ComboBox1.AddItem "RT (5.4t)x88.9"
UserForm1.ComboBox1.AddItem "RT (6t)x101.6"
UserForm1.ComboBox1.AddItem "RTP (1.2t) 13x50"
UserForm1.ComboBox1.AddItem "RTP (1.5t) 19x25"
UserForm1.ComboBox1.AddItem "RTP (2t) 20x40"
UserForm1.ComboBox1.AddItem "RTP (2t) 20x50"
UserForm1.ComboBox1.AddItem "RTP (2t) 25x50"
UserForm1.ComboBox1.AddItem "RTP (2.5t)25x50"
UserForm1.ComboBox1.AddItem "RTP (3t) 25x50"
UserForm1.ComboBox1.AddItem "RTP (2t) 25 x 75"
UserForm1.ComboBox1.AddItem "RTP (3t) 25x75"
UserForm1.ComboBox1.AddItem "RTP (3t)40x50"
UserForm1.ComboBox1.AddItem "RTP (3t) 40x80"
UserForm1.ComboBox1.AddItem "RTP (2) 50x75"
UserForm1.ComboBox1.AddItem "RTP (2.5t) 50X75"
UserForm1.ComboBox1.AddItem "RTP (3t)50x75"
UserForm1.ComboBox1.AddItem "RTP (4t) 50 X 75"
UserForm1.ComboBox1.AddItem "RTP (2.5t) 50x100"
UserForm1.ComboBox1.AddItem "RTP (4t) 50X100"
UserForm1.ComboBox1.AddItem "RTP (6t) 50x100"
UserForm1.ComboBox1.AddItem "RTP (1.2t) 50X150"
UserForm1.ComboBox1.AddItem "RTP (2t) 50X150"
UserForm1.ComboBox1.AddItem "RTP (3t) 50X150"
UserForm1.ComboBox1.AddItem "RTP (4t) 50X150"
UserForm1.ComboBox1.AddItem "RTP (9t) 100x200"
UserForm1.ComboBox1.AddItem "SIGNAGE GRAPES"
UserForm1.ComboBox1.AddItem "SL-01 L/R"
UserForm1.ComboBox1.AddItem "SL-01 A"
UserForm1.ComboBox1.AddItem "SL-2/R"
UserForm1.ComboBox1.AddItem "SL-2/L"
UserForm1.ComboBox1.AddItem "SL-04 L/R"
UserForm1.ComboBox1.AddItem "SL-5"
UserForm1.ComboBox1.AddItem "SL-07 L/R"
UserForm1.ComboBox1.AddItem "SL-9"
UserForm1.ComboBox1.AddItem "SL-10"
UserForm1.ComboBox1.AddItem "SL-11"
UserForm1.ComboBox1.AddItem "SL-13/B"
UserForm1.ComboBox1.AddItem "SL-14"
UserForm1.ComboBox1.AddItem "SL-22"
UserForm1.ComboBox1.AddItem "SL-23"
UserForm1.ComboBox1.AddItem "SL-24"
UserForm1.ComboBox1.AddItem "SP-001"
UserForm1.ComboBox1.AddItem "SP-004"
UserForm1.ComboBox1.AddItem "SP-005"
UserForm1.ComboBox1.AddItem "SP-008"
UserForm1.ComboBox1.AddItem "SP-010"
UserForm1.ComboBox1.AddItem "SP-011"
UserForm1.ComboBox1.AddItem "SP-012"
UserForm1.ComboBox1.AddItem "SP-012/a"
UserForm1.ComboBox1.AddItem "SP-014"
UserForm1.ComboBox1.AddItem "SP-015"
UserForm1.ComboBox1.AddItem "SP-016"
UserForm1.ComboBox1.AddItem "SMR01"
UserForm1.ComboBox1.AddItem "SMR02"
UserForm1.ComboBox1.AddItem "SPH-013/S"
UserForm1.ComboBox1.AddItem "SPH-015/S"
UserForm1.ComboBox1.AddItem "SPH-020/S"
UserForm1.ComboBox1.AddItem "SPH-025/S"
UserForm1.ComboBox1.AddItem "SPH-025/F"
UserForm1.ComboBox1.AddItem "SPH-030/S"
UserForm1.ComboBox1.AddItem "SPH-050"
UserForm1.ComboBox1.AddItem "STAINLESS ROD "
UserForm1.ComboBox1.AddItem "STAINLESS ROD "
UserForm1.ComboBox1.AddItem "STAINLESS ROD "
UserForm1.ComboBox1.AddItem "SQP (1.2t) 13x13"
UserForm1.ComboBox1.AddItem "SQP (1.2t) 16x16"
UserForm1.ComboBox1.AddItem "SQP (1.5t) 19x19"
UserForm1.ComboBox1.AddItem "SQP (2t) 19x19"
UserForm1.ComboBox1.AddItem "SQP (2.5) 19x19"
UserForm1.ComboBox1.AddItem "SQP (2t) 25x25"
UserForm1.ComboBox1.AddItem "SQP (3t) 25x25"
UserForm1.ComboBox1.AddItem "SQP (2t) 30X30"
UserForm1.ComboBox1.AddItem "SQP (2.5t) 30X30"
UserForm1.ComboBox1.AddItem "SQP(3t) 30x30"
UserForm1.ComboBox1.AddItem "SQP (3t) 38x38"
UserForm1.ComboBox1.AddItem "SQP (3t) 40X40"
UserForm1.ComboBox1.AddItem "SQP (2t) 50x50"
UserForm1.ComboBox1.AddItem "SQP (4t) 50X50"
UserForm1.ComboBox1.AddItem "SQP (5t) 50x50"
UserForm1.ComboBox1.AddItem "SQP (3t) 60x60"
UserForm1.ComboBox1.AddItem "SQP (4t) 60x60"
UserForm1.ComboBox1.AddItem "SQP (4t) 75x75"
UserForm1.ComboBox1.AddItem "SQP (6t) 75x75"
UserForm1.ComboBox1.AddItem "SQP (4t) 100x100"
UserForm1.ComboBox1.AddItem "SQP (6t) 100x100"
UserForm1.ComboBox1.AddItem "SQP (4t) 150X150"
UserForm1.ComboBox1.AddItem "SQP (6t) 150x150"
UserForm1.ComboBox1.AddItem "SQP (9t) 200X200"
UserForm1.ComboBox1.AddItem "SB 4x4"
UserForm1.ComboBox1.AddItem "SB 6x6"
UserForm1.ComboBox1.AddItem "SB 8x8"
UserForm1.ComboBox1.AddItem "SB 10x10"
UserForm1.ComboBox1.AddItem "SB 12x12"
UserForm1.ComboBox1.AddItem "SB 16x16"
UserForm1.ComboBox1.AddItem "SB 20x20"
UserForm1.ComboBox1.AddItem "SB 25x25"
UserForm1.ComboBox1.AddItem "SB 30x30"
UserForm1.ComboBox1.AddItem "STEEL MATTING ?5.5"
UserForm1.ComboBox1.AddItem "STEEL MATTING ?4.5"
UserForm1.ComboBox1.AddItem "TB 4X4"
UserForm1.ComboBox1.AddItem "TB 3401"
UserForm1.ComboBox1.AddItem "TB 3422"
UserForm1.ComboBox1.AddItem "TB 3432"
UserForm1.ComboBox1.AddItem "TB 5873"
UserForm1.ComboBox1.AddItem "WS 3052"
UserForm1.ComboBox1.AddItem "WS 3053"
UserForm1.ComboBox1.AddItem "WS 3095"
UserForm1.ComboBox1.AddItem "WS 3097"
UserForm1.ComboBox1.AddItem "WS 7039"
UserForm1.ComboBox1.AddItem "WS 7102"
UserForm1.ComboBox1.AddItem "WOOD GRAIN SH"
UserForm1.ComboBox1.AddItem "ZS-3001 L/R (F-037)"
UserForm1.ComboBox1.AddItem "ZS-3002 L/R (F-087)"
UserForm1.ComboBox1.AddItem "ZS-3005 (F-036)"
UserForm1.ComboBox1.AddItem "ZS-3006 L/R"
UserForm1.ComboBox1.AddItem "ZS-3015 (F-097)"
UserForm1.ComboBox1.AddItem "ZS-3021 L/R"
UserForm1.ComboBox1.AddItem "ZS-3022 L/R (F-035)"
UserForm1.ComboBox1.AddItem "ZS-3023 L/R (F-028)"
UserForm1.ComboBox1.AddItem "ZS-3027 L/R (F-045)"
UserForm1.ComboBox1.AddItem "ZS-3033 (F-092)"
UserForm1.ComboBox1.AddItem "ZS-3049 L/R (F-021)"
UserForm1.ComboBox1.AddItem "ZS-3050 (F-103)"
UserForm1.ComboBox1.AddItem "ZS-3059 PAS"
UserForm1.ComboBox1.AddItem "ZS-3061"
UserForm1.ComboBox1.AddItem "ZS-3070"
UserForm1.ComboBox1.AddItem "ZS-3080 L/R (F-115)"
UserForm1.ComboBox1.AddItem "ZS-3087 L/R (F-113)"
UserForm1.ComboBox1.AddItem "ZS-3088 L/R (F-091)"
UserForm1.ComboBox1.AddItem "ZS-3090"
UserForm1.ComboBox1.AddItem "ZS-3091"
UserForm1.ComboBox1.AddItem "ZS-3097 L/R"
UserForm1.ComboBox1.AddItem "SZ-C001B"
UserForm1.ComboBox1.AddItem "SZ-C001S"
UserForm1.ComboBox1.AddItem "SZ-C030"
UserForm1.ComboBox1.AddItem "SZ-C031A"
UserForm1.ComboBox1.AddItem "SZ-C031B"
UserForm1.ComboBox1.AddItem "SZ-C039A"
UserForm1.ComboBox1.AddItem "ZS-3116"
UserForm1.ComboBox1.AddItem "TWT 34?x300"
UserForm1.ComboBox1.AddItem "TWT 82.6?x1015"
UserForm1.ComboBox1.AddItem "TWT 150?x210"
UserForm1.ComboBox1.AddItem "TWT 150?x160"
UserForm1.ComboBox1.AddItem "MSP t25x400?"
UserForm1.ComboBox1.AddItem "MSP t25x300?"
UserForm1.ComboBox1.AddItem "~"
UserForm1.ComboBox2.List = UserForm1.ComboBox1.List
UserForm1.ComboBox3.List = UserForm1.ComboBox1.List
UserForm1.ComboBox4.List = UserForm1.ComboBox1.List
UserForm1.ComboBox5.List = UserForm1.ComboBox1.List
UserForm1.ComboBox6.List = UserForm1.ComboBox1.List
UserForm1.ComboBox7.List = UserForm1.ComboBox1.List
UserForm1.ComboBox8.List = UserForm1.ComboBox1.List
UserForm1.ComboBox9.List = UserForm1.ComboBox1.List
UserForm1.ComboBox10.List = UserForm1.ComboBox1.List
UserForm1.ComboBox11.List = UserForm1.ComboBox1.List
UserForm1.ComboBox12.List = UserForm1.ComboBox1.List
UserForm1.ComboBox13.List = UserForm1.ComboBox1.List
UserForm1.ComboBox14.List = UserForm1.ComboBox1.List
UserForm1.ComboBox15.List = UserForm1.ComboBox1.List
End Sub
Private Sub CommandButton2_Click()
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
'declare local variables

Set xlbook = GetObject("C:'matlist.xls")
'set reference to Excel file
Set xlapp = xlbook.Parent
'set reference to workbook
xlapp.Visible = True
'make Excel visible
xlapp.Windows("MATLIST.XLS").Visible = True
'make the workbook visible
'the 2 preceeding lines can be commented out if you
'do not want to see Excel in action

Set xlsheet = xlbook.Sheets("SHEET1")
'set reference to the worksheet Sheet1
xlsheet.Cells(7, 3) = UserForm1.ComboBox1.Text
xlsheet.Cells(8, 3) = UserForm1.ComboBox2.Text
xlsheet.Cells(9, 3) = UserForm1.ComboBox3.Text
xlsheet.Cells(10, 3) = UserForm1.ComboBox4.Text
xlsheet.Cells(11, 3) = UserForm1.ComboBox5.Text
xlsheet.Cells(12, 3) = UserForm1.ComboBox6.Text
xlsheet.Cells(13, 3) = UserForm1.ComboBox7.Text
xlsheet.Cells(14, 3) = UserForm1.ComboBox8.Text
xlsheet.Cells(15, 3) = UserForm1.ComboBox9.Text
xlsheet.Cells(16, 3) = UserForm1.ComboBox10.Text
xlsheet.Cells(17, 3) = UserForm1.ComboBox11.Text
xlsheet.Cells(18, 3) = UserForm1.ComboBox12.Text
xlsheet.Cells(19, 3) = UserForm1.ComboBox13.Text
xlsheet.Cells(20, 3) = UserForm1.ComboBox14.Text
xlsheet.Cells(21, 3) = UserForm1.ComboBox15.Text
xlsheet.Cells(7, 4) = UserForm1.TextBox1.Text
xlsheet.Cells(8, 4) = UserForm1.TextBox2.Text
xlsheet.Cells(9, 4) = UserForm1.TextBox3.Text
xlsheet.Cells(10, 4) = UserForm1.TextBox4.Text
xlsheet.Cells(11, 4) = UserForm1.TextBox5.Text
xlsheet.Cells(12, 4) = UserForm1.TextBox6.Text
xlsheet.Cells(13, 4) = UserForm1.TextBox7.Text
xlsheet.Cells(14, 4) = UserForm1.TextBox8.Text
xlsheet.Cells(15, 4) = UserForm1.TextBox9.Text
xlsheet.Cells(16, 4) = UserForm1.TextBox10.Text
xlsheet.Cells(17, 4) = UserForm1.TextBox11.Text
xlsheet.Cells(18, 4) = UserForm1.TextBox12.Text
xlsheet.Cells(19, 4) = UserForm1.TextBox13.Text
xlsheet.Cells(20, 4) = UserForm1.TextBox14.Text
xlsheet.Cells(21, 4) = UserForm1.TextBox15.Text
UserForm1.TextBox17.Text = xlsheet.Cells(7, 7)
UserForm1.TextBox18.Text = xlsheet.Cells(8, 7)
UserForm1.TextBox19.Text = xlsheet.Cells(9, 7)
UserForm1.TextBox20.Text = xlsheet.Cells(10, 7)
UserForm1.TextBox21.Text = xlsheet.Cells(11, 7)
UserForm1.TextBox22.Text = xlsheet.Cells(12, 7)
UserForm1.TextBox23.Text = xlsheet.Cells(13, 7)
UserForm1.TextBox24.Text = xlsheet.Cells(14, 7)
UserForm1.TextBox25.Text = xlsheet.Cells(15, 7)
UserForm1.TextBox26.Text = xlsheet.Cells(16, 7)
UserForm1.TextBox27.Text = xlsheet.Cells(17, 7)
UserForm1.TextBox28.Text = xlsheet.Cells(18, 7)
UserForm1.TextBox29.Text = xlsheet.Cells(19, 7)
UserForm1.TextBox30.Text = xlsheet.Cells(20, 7)
UserForm1.TextBox31.Text = xlsheet.Cells(21, 7)
UserForm1.TextBox32.Text = xlsheet.Cells(7, 9)
UserForm1.TextBox33.Text = xlsheet.Cells(8, 9)
UserForm1.TextBox34.Text = xlsheet.Cells(9, 9)
UserForm1.TextBox35.Text = xlsheet.Cells(10, 9)
UserForm1.TextBox36.Text = xlsheet.Cells(11, 9)
UserForm1.TextBox37.Text = xlsheet.Cells(12, 9)
UserForm1.TextBox38.Text = xlsheet.Cells(13, 9)
UserForm1.TextBox39.Text = xlsheet.Cells(14, 9)
UserForm1.TextBox40.Text = xlsheet.Cells(15, 9)
UserForm1.TextBox41.Text = xlsheet.Cells(16, 9)
UserForm1.TextBox42.Text = xlsheet.Cells(17, 9)
UserForm1.TextBox43.Text = xlsheet.Cells(18, 9)
UserForm1.TextBox44.Text = xlsheet.Cells(19, 9)
UserForm1.TextBox45.Text = xlsheet.Cells(20, 9)
UserForm1.TextBox46.Text = xlsheet.Cells(21, 9)
UserForm1.TextBox47.Text = xlsheet.Cells(28, 3)
xlbook.SaveAs ("C:'OMQuotation.xls")
xlbook.Close savechanges:=True
'save the changes in Excel
xlapp.Quit
'quit Excel
'Set xlsheet = Nothing
'Set xlbook = Nothing
'Set xlapp = Nothing
'clean up

End Sub
Private Sub UserForm_Initialize()
Dim EntGrp(0) As Integer
Dim EntPrp(0) As Variant
Dim BlkObj As Object
Dim Pt1(0) As Double
Dim Pt2(0) As Double

'define error function
On Error GoTo Err_Control

'create a selection set
Set ssnew = ThisDocument.SelectionSets.Add("OWIBLK")

'Filter for Group code 2, the block name
EntGrp(0) = 2

'The name of the block to filter for
EntPrp(0) = "MATCOMP"

'find the block
ssnew.Select zwSelectionSetAll, Pt1, Pt2, EntGrp, EntPrp

'If a block is found
If ssnew.Count >= 1 Then

'Get the block's attributes
Tatts = ssnew.Item(0).GetAttributes

UserForm1.ComboBox1.SetFocus
UserForm1.ComboBox1.SelStart = 0
UserForm1.ComboBox1.SelLength = Len(UserForm1.ComboBox1.Text)
'set the focus to the drawing title and highlight it

Else
'no attribute block, inform the user
MsgBox "No Title Block Attributes - Use Manual Edit..", vbCritical, "Onda Material List"

'delete the selection set
ThisDocument.SelectionSets.Item("OWITBLK").Delete

End

End If

Exit Sub

Err_Control:
'disply error number and description
MsgBox Err.Number & " " & Err.Description

End

End Sub
Sub UpdateAttrib(TagNumber As Integer, BTextString As String)

'This procedure checks to see if the text box has a value.
'If it does, it applies the text to the attribute.
'If not, it applies an empty string to the attribute.
If BTextString = "" Then

Tatts(TagNumber).TextString = ""

Else

Tatts(TagNumber).TextString = BTextString

End If

End Sub



Thanks in advance

Ariel Serrano
See also
X