Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I think i am missing something really small but i cant find it for the life of me
I want the first if statement run if NUMBER_OF_TAGS is less then 49 and it its higher than 49 run the else if statement but for some reason my else if statement is activating before my first if statement
MessageBox.Show("Browse to Excel with the Tag Numbers","File Location", MessageBoxButtons.OK) iLogicVb.RunRule("Excel_Location") MessageBox.Show("Browse to where you want the DXFs or PDFs exported to", "File Location", MessageBoxButtons.OK) iLogicVb.RunRule("DXF_Location") iProperties.Value("Custom", "NUMBER_OF_TAGS") = InputBox("How many tags are there?", "Tag Quantity", "Numerical Number Only") question = MessageBox.Show("Do you want to preview the DXF as a PDF before exporting?", "iLogic Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If question = vbYes & iProperties.Value("Custom", "NUMBER_OF_TAGS") <= "49" Then iProperties.Value("Custom", "Tag_1") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A1") iProperties.Value("Custom", "Tag_1") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A2") iProperties.Value("Custom", "Tag_3") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A3") iProperties.Value("Custom", "Tag_4") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A4") iProperties.Value("Custom", "Tag_5") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A5") iProperties.Value("Custom", "Tag_6") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A6") iProperties.Value("Custom", "Tag_7") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A7") iProperties.Value("Custom", "Tag_8") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A8") iProperties.Value("Custom", "Tag_9") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A9") iProperties.Value("Custom", "Tag_10") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A10") iProperties.Value("Custom", "Tag_11") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A11") iProperties.Value("Custom", "Tag_12") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A12") iProperties.Value("Custom", "Tag_13") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A13") iProperties.Value("Custom", "Tag_14") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A14") iProperties.Value("Custom", "Tag_15") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A15") iProperties.Value("Custom", "Tag_16") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A16") iProperties.Value("Custom", "Tag_17") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A17") iProperties.Value("Custom", "Tag_18") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A18") iProperties.Value("Custom", "Tag_19") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A19") iProperties.Value("Custom", "Tag_20") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A20") iProperties.Value("Custom", "Tag_21") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A21") iProperties.Value("Custom", "Tag_22") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A22") iProperties.Value("Custom", "Tag_23") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A23") iProperties.Value("Custom", "Tag_24") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A24") iProperties.Value("Custom", "Tag_25") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A25") iProperties.Value("Custom", "Tag_26") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A26") iProperties.Value("Custom", "Tag_27") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A27") iProperties.Value("Custom", "Tag_28") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A28") iProperties.Value("Custom", "Tag_29") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A29") iProperties.Value("Custom", "Tag_30") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A30") iProperties.Value("Custom", "Tag_31") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A31") iProperties.Value("Custom", "Tag_32") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A32") iProperties.Value("Custom", "Tag_33") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A33") iProperties.Value("Custom", "Tag_34") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A34") iProperties.Value("Custom", "Tag_35") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A35") iProperties.Value("Custom", "Tag_36") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A36") iProperties.Value("Custom", "Tag_37") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A37") iProperties.Value("Custom", "Tag_38") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A38") iProperties.Value("Custom", "Tag_39") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A39") iProperties.Value("Custom", "Tag_40") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A40") iProperties.Value("Custom", "Tag_41") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A41") iProperties.Value("Custom", "Tag_42") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A42") iProperties.Value("Custom", "Tag_43") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A43") iProperties.Value("Custom", "Tag_44") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A44") iProperties.Value("Custom", "Tag_45") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A45") iProperties.Value("Custom", "Tag_46") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A46") iProperties.Value("Custom", "Tag_47") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A47") iProperties.Value("Custom", "Tag_48") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A48") iProperties.Value("Custom", "Tag_49") = GoExcel.CellValue(iProperties.Value("Custom", "EXCEL_LOCATION"), "Sheet1", "A49") InventorVb.DocumentUpdate() ActiveSheet.View("DXF_View_Sheet1").View.Suppressed = False ActiveSheet.View("PDF_View_Sheet1").View.Suppressed = True Dim Time As DateTime = DateTime.Now Dim Format As String = "yyyyMdHHmm" iProperties.Value("Custom", "CURRENT_DATE") = Time.ToString(Format) file_path = iProperties.Value("Custom", "DXF_LOCATION") file_name = iProperties.Value("Custom", "CURRENT_DATE") & " Sheet 1" file_name_path = file_path & "\" & file_name ThisDoc.Document.SaveAs(file_name_path & ".pdf", True) ActiveSheet.View("DXF_View_Sheet1").View.Suppressed = True ActiveSheet.View("PDF_View_Sheet1").View.Suppressed = False Else If question = vbYes & iProperties.Value("Custom", "NUMBER_OF_TAGS") >= "49" Then MessageBox.Show("Sorry i am not ready to go higher than 49 right now", "Title") Else If question = vbNo Then End If
Solved! Go to Solution.