view_get_views returns null I have a module function which needs to get the raw results of a view, so I use this bit of code:

$view = views_get_view('sluitingsuren_bakker');
  $view-&gt;preview();

  return $view-&gt;result;


The views machine name is sluitingsuren_bakker. I also tried some other views, but it seems the module can't find any of the views.

Also I set my permissions on this view to none, because I thought that was the problem.
You are missing the display name, which is the machine name of the block/page. 

You can find the machine name under Advanced settings in the right side of the view.

try:

   &lt;?php 
    $view = views_get_view(view_name);
    $view-&gt;set_display(machine_name);
    $view-&gt;preview();
    return $view-&gt;result
    ?&gt;