Message 1 of 2
Not applicable
04-19-2016
02:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have the following piece of code that works well, but it annoyingly pops open the excel spreadsheet and asks "Want to save changes to 'RPT-E2I-001 - Contracts Overview Report.xlsm'?"
How can I stop this from happening? I don't want any of our users seeing/opening/editing the spreadsheet, but I want the rule to read from it discreetly.
Sub Main () question = MessageBox.Show("Do you want to link the case to e2i?" & Chr(10) & "Click <No> if you want enter the case specification manually.", "iLogic Question",MessageBoxButtons.YesNo,MessageBoxIcon.Question) 'set condition based on answer If question = vbYes Then 'Set excel spreadsheet absolute file path and search for case number match(taken from Part Number iproperty) GoExcel.TitleRow = 3 i = GoExcel.FindRow("F:\Operations\e2i\Reports\RPT-E2I-001 - Contracts Overview Report.xlsm", "Cases", "Case No", "=", iProperties.Value("Project", "Part Number")) 'If case number match is found in e2i If i <> -1 Then contract_name = GoExcel.CurrentRowValue("Contract Description") contract_number = GoExcel.CurrentRowValue("Contract No") contract_case_qty = GoExcel.CurrentRowValue("Case QTY") contract_manager = GoExcel.CurrentRowValue("PM") contract_technical_lead = GoExcel.CurrentRowValue("Technical Lead") contract_case_type = GoExcel.CurrentRowValue("Case Type") Else 'If case number match is not found in e2i contract_name = "No matching case in e2i" contract_number = "No matching case in e2i" contract_case_qty = "No matching case in e2i" contract_manager = "No matching case in e2i" contract_technical_lead = "No matching case in e2i" contract_case_type = "No matching case in e2i" MessageBox.Show("There is no matching case in e2i", "Title") End If Else If question = vbNo Then End If End Sub
Solved! Go to Solution.