Is there a bus or train that goes directly from Venice to Ljubljana, Slovenia?
Here's a link to at least one bus company that does so. http://www.drd.si/en/default.aspx?ID=199
You could also train from Venice to Trieste and take a bus from there to Ljubljana. Pretty easy to do. Bus station in Trieste is across the street from the train station.
We traveled from Slovenia to Venice in 2011. The best way I found was the bus from Venice to Ljublljana. The route was beautiful and the bus was comfortable.