Python Dash application with drop down menu that selects excel file sheets and displays in a table

I am in the process of learning Dash with the final goal being the development of an app that allows quick analysis of data sets in an excel file. I’d like a drop down menu that will allow for switching between the sheets in the excel file. I’m having trouble getting this to run properly. I can make it output to a graph but not a table. My code is as follows:

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import dash_table_experiments as dt
import pandas as pd

app = dash.Dash()

df = pd.read_excel('output.xlsx', sheet_name=None)

app.layout = html.Div(
                           options=[{'label': i, 'value': i} for i in df],

@app.callback(Output('table', 'rows'), [Input('drop_value', 'value')])
def update_info_table(drop_value):
    if drop_value == 'Sheet1':
        new_data = df['Sheet1'].to_dict()
        return new_data
    elif drop_value == 'Sheet2':
        new_data = df['Sheet2'].to_dict()
        return new_data
        new_data = df['Sheet3'].to_dict()
        return new_data

if __name__ == '__main__':

When I run this code I get the following error:
TypeError: init() takes from 1 to 2 positional arguments but 3 were given

I’m assuming this has something to do with the format of the dataset I’m trying to feed to the datatable. Right now I’m just using a dummy excel file with only two columns labeled ‘x1’ and ‘y1’.

لینک منبع

excel vba – Spurious Subscript Out of Range error

I have a User Form in Excel 2016 invoked from an ActiveX button on a Worksheet, which works fine but for a, “Subscript Out of Range”, error reported on this line:

intStatID = tblStat.Add(objStat)

I know it’s odd to say everything works fine but for this error. Such errors are normally catastrophic and a sure sign something’s wrong somewhere. But on this occasion I use the debugger to step my way through the code, through various nested functions and subs, all the way back to the line below that above, and even forward from there to the conclusion of the processing of the user interaction. And I never get to a line of code through which I cannot successfully step!

So all the user needs to do is hit F5 when the problem is reported and everything’s fine – but it’s not the user experience I’m seeking! Can anyone point me in the right direction, please?

لینک منبع

list – Excel Assigning functions to text

I am wondering how to do this:

For every F in a list, it means to add 1 to the input number
For every Q in a list, it means to take away 1 from the last output.

For example:
Number = 2
output = 3 -> 1,2,3,4,3

The formula will need to read from different line inputs and then go through the processes of F and Q until it reaches a final output.

Thank You.

لینک منبع

excel – Compare four columns and return result based on the combination

I have different values ranging between 1 to 4 in four different columns. I need the result based on these four values.
For eg., Column A – 1, Column B – 1, Column C – 1, Column D – 1, it should return result as P1.
If it is, Column A – 2, Column B – 2, Column C – 2, Column D – 4,it should return result as P1. Like this I have 23 combinations.
Any easy method to do this?

لینک منبع

ole – EXCEL recalculating open file. how to disable it?

I Have a problem withc excel and one program. When i open a 7Mb excel file it tooks 500MB of ram and openning in 15 seconds. BUT if this file is open and i want to open in my program OLE EXCEL with another program i stucked and waiting for recalcalation of the open file…
a partial solution is to disable recalculation formulas in big file…but i dont’i want do this..

BIG file and OLE don’t have any common formuals or data. Why excel opening OLE in this process?
How to separate them?

Thanks for your help!

لینک منبع

Automatic update of excel sheet while other excel sheet refreshes using VBA/VBS

I’ve a master sheet which runs macro using VBS (scheduled on windows task scheduler to run every 15 mins) and renders results into master sheet cells B2..Bi. Note that this master sheet is sitting on a shared drive – This is working absolutely fine.

What I would like is below:-

I’ve a client sheet which potentially will be open by 1 or more users on their desktop. I would like to refresh this client sheet as soon as master sheet has data updated/deleted/inserted..etc..

Important point is client sheet is like a dashboard and has ActiveX TextBox Controls where I render my results from the master sheet cells B2..Bi.
For e.g: TextBox1 would have data from master sheet Cell B2, TextBox2 would have data from master sheet Cell B3 and so on..

Can someone give me hints on doing this?

Thank you.


Below is the master sheet example:

enter image description here

Below is Client sheet running on multiple desktops:

enter image description here

لینک منبع

importing data from excel to db using php

can anyone help me why when i import the data the result is like that in the database i have provided the screenshot and the link . thanks
data in the db https://i.stack.imgur.com/TCmn1.png

    <form enctype="multipart/form-data" method="post" action="import.php" role="form">
        <div class="form-group">
            <label for="exampleInputFile">File Upload</label>
            <input type="file" name="file" id="file" size="150">
            <p class="help-block">Only Excel/CSV File Import.</p>
        <button type="submit" class="btn btn-default" name="Import" value="Import">Upload</button>

    //First we need to make a connection with the database
    $host='localhost'; // Host Name.
    $db_user= 'root'; //User Name
    $db_password= '';
    $db= 'testdatabase'; // Database Name.
    $conn=mysql_connect($host,$db_user,$db_password) or die (mysql_error());
    mysql_select_db($db) or die (mysql_error());
    echo $filename=$_FILES["file"]["tmp_name"];
    if($_FILES["file"]["size"] > 0)
        $file = fopen($filename, "r");
        $count = 0;
        $sql_data = "SELECT * FROM person";
        echo $sql_data;
        while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE)
            if($count > 1) {
            $sql = "INSERT into person(firstname , lastname) values ('$emapData[0]','$emapData[1]')";

        echo 'CSV File has been successfully Imported';
        header('Location: index.php');
        echo 'Invalid File:Please Upload CSV File';

لینک منبع

excel – Finding row property from range object

Some history would fun to start this off with. I am a self taught Java programmer and haven’t ventured off much at all. I started 10 years ago. Have kind of lost interest in the hobby a few years ago. Now I’m a maintenance supervisor for a small manufacturer and have found interest in doing this project.

I’m creating a formula in excel to parse a list of “parts” from a cell. Lookup a cell in another worksheet with that part name, and then use the address of that cell found to get the cost of the part from the same row, different column. I’ve worked hours on this and thoroughly read the docs online but stuck here.

Here is the code in question:

Public Function PartCost() As Integer
Dim PList() As String
PList = Split(Cells(Application.Caller.Row, 4).Value, ", ")

Dim element As Variant
Dim curCell As Variant
PartCost = 0

For Each element In PList
    curCell = Worksheets("Parts List").Range("A1:A100").Find(element)
    PartCost = PartCost + Cells(curCell.Row, 3).Value
Next element

End Function

Basically through the use of MsgBox I’ve found that it does find the entry in the other “Parts List” worksheet but if i use the curCell to print out the address, row, or column I get no results.

لینک منبع

excel vba – How to combine consecutive values in a column with the help of VBA?

I have a data like this :


And i want the output like :

enter image description here

As you can see, i want the ranges which are in consecutive order

i am trying some thing like this:

Private Sub CommandButton1_Click()

Set wb = ThisWorkbook
lastRow = wb.Sheets("Sheet1").Range("A" & wb.Sheets("Sheet1").Rows.Count).End(xlUp).Row
For i = 2 To lastRow
    r = wb.Sheets("Sheet1").Range("A" & i).Value

    If wb.Sheets("Sheet1").Range("A" & i).Value = wb.Sheets("Sheet1").Range("A" & i+1).Value
    Next i

End Sub

But not helping me

لینک منبع

Master Microsoft Office programs like Excel and PowerPoint for $19

The skills every job seeker needs for under $20.
The skills every job seeker needs for under $20.

Image: pexels

Don’t let your Google Docs-loving friends tell you otherwise – Microsoft Office is still the king of the professional world. If you want to be a top performer in the office, you need to have a solid understanding of the Microsoft Office Suite. These programs can be challenging to learn, but there’s a new collection of online classes that’s great for newbies and experienced users alike: The Complete Microsoft Office Certification Bundle.

This four-course collection gives you 20 hours of instruction in Excel, PowerPoint, and Access so you can not only learn the necessary skills but pass the official Microsoft certification exams. You’ll learn essential features like how to create spreadsheets, presentations, and databases, as well as advanced features like how to create macros, track changes, use animations, and query tables. Whether you want to brush up on your skills or get certified by Microsoft, these courses will help you immensely.

The Complete Microsoft Office Certification Bundle normally costs $2980, but you can get it for just $19, a savings of 99%.

لینک منبع