'The scrollbar widget shows up in the frame, why cant I actually scroll with it?

So I want my treeview widget with an opened excel file to be able to scroll left and right but when I add the scrollbar widget and run the program the scroll bar shows up but I am unable to scroll with it. enter image description here

Here is the code for my treeview and frames:

    Frame0=Frame(FrameMain, bd=2, width=1330, height=450,padx=5,bg="light grey", relief=RIDGE)
    Frame0.grid(row=0, column=0,sticky=W)
    Frame0.grid_propagate(0)

    TreeviewFrame=Frame(Frame0, bd=2,width=1330, height=800,padx=5,bg="light grey", relief=RIDGE)
    TreeviewFrame.grid(row=0, column=0,sticky=W)
    TreeviewFrame.grid_propagate(0)

    fr_x = ttk.Frame(TreeviewFrame)
    fr_x.pack(side='top', fill='x')

    ButtonFrame=Frame(FrameMain, bd=2, width=580, height=33,padx=5,bg="light grey", relief=RIDGE)
    ButtonFrame.grid(row=1, column=0, sticky=SW)
    ButtonFrame.grid_propagate(0)

    self.tree=ttk.Treeview(TreeviewFrame)
  
    label=Label(TreeviewFrame, text='Excel File Will Show Here')
    label.pack()
    label.grid_propagate(0)

    treeScrollBar=ttk.Scrollbar(fr_x, orient= "horizontal", command=self.tree.xview)
    treeScrollBar.pack(expand='yes', fill='x')
    
    self.tree.configure(xscroll=treeScrollBar.set)
    self.tree.pack(fill='both', expand='yes')

I have tried messing around with my frames because I feel like I'm using the wrong frames when trying to set the scrollbar and that's why its not showing that its able to scroll but I have had no luck. Any help is appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source