Hello,
You can find an example that does that in LabVIEW => Help => Find Examples (The NI Example Finder window will open) => in the Browse Tab go to Hardware Input and Output => Traditional DAQ => Analog Input => Stream to Disk and finally double click on Cont Acq to Spreadsheet File.VI.
Please let me know if you had problems finding this example.
Regards,
LA