Please verify the document and uploaded again" ReturnVal = " The version is not corrected, If(templatetype.ToUpper() != _templatetype.ToUpper()) ReturnVal = " Please verify the data before upload to the server!" Out branchID, out planDate, out startDate, out endDate, Protected worksheets and workbook based on requirement:.Ws.get_Range( " G" + currentRow, ).Value2 = Ws.get_Range( " F" + currentRow, ).Value2 = String sql = " SELECT ProductCategoryID, Name FROM ProductCategory" ĭataSet ds = SqlHelper.ExecuteDataset(connnectionString, CommandType.Text, sql) įoreach (DataRow dr in ds.Tables.Rows) Private void LoadCategoryDataSource(Worksheet ws) ws.Visible = XlSheetVisibility.xlSheetVisible LoadUserDataSource(wb, ws, beginDate.ToString(PlanDateFormat)) Ws.get_Range( " A7",).Value2 = _templatetype Ws.get_Range( " A5",).Value2 = endDate.ToString( " yyyy-MM-dd") Ws.get_Range( " A4",).Value2 = beginDate.ToString( " yyyy-MM-dd") Ws.get_Range( " A1",).Value2 = 0 // Check flag Private void LoadDataSource(Worksheet ws, Workbook wb, DateTime beginDate,ĭataSet ds = SqlHelper.ExecuteDataset(connnectionString, CommandType.Text, " ") LoadDataSource(ws, wb, beginDate, endDate) VBA programming to add list validation or auto-fill is as follows:.Set the layout, add validation button and add new button.Create a named range for list validation (if the data is already known).Clarify the data type in each cell, fill in type (user input/list validation or a pop form) and the lock property.
Using the Code Step 1: Create the Excel Template Based on Requirement The AdventureWorks database could be downloaded from the Microsoft download center. Secondly, all the salesmen are experts in Excel and the training will be much easier. First of all, it’s cheaper because no additional software/hardware is needed. Then an offline solution is needed and using Excel template is the best solution. But most of the salesmen travel a lot and they cannot access the site on-time.
Generate an Excel template to fill with the source data.Clarify the requirement and create the Excel template.
The end user could download the template and fill it in and then upload it to the server, and the server will read the template and update the database. This is a sample to create an Excel template for a specified purpose.