Unable to export bookmarks to HTML file - Firefox
This article applies to Firefox 3
Some Firefox 3 users may be unable to export bookmarks to an HTML file because the bookmarks file is not saved, no matter which folder location is chosen.   As a first step, exit Firefox completely (or reboot the computer) and then reopen Firefox. If you are now able to export your bookmarks, a previous Firefox process may not have closed properly. If this is a recurring problem, see this article.
If you are unable to export your bookmarks to an HTML file, even after restarting the computer, try the following:
Back up and restore bookmarks
You may be able to fix the problem by creating a bookmark backup file, which will be in JSON format, and then restoring the backup. 
- Open the Library Window and select the Backup feature ("Bookmarks -> Organize Bookmarks -> Import and Backup -> Backup").
- Save the bookmark backup file, which will be in JSON format, to an easy to find location, such as the desktop.
- Go back to the Library window and select the "Restore" feature ("Bookmarks -> Organize Bookmarks -> Import and Backup -> Restore").
- From the Restore menu, select the "Choose File.." option and browse to the JSON bookmarks file you backed up previously.
- Try exporting your bookmarks again.
- Disable all extensions via the Firefox Add-ons manager ("Tools -> Add-ons -> Extensions") or use the Firefox Safe Mode startup option to disable all add-ons.  If you are able to export your bookmarks with all extensions disabled, re-enable them one at a time to find the one that is causing the problem. For a systematic approach to troubleshooting extensions, see the Firefox standard diagnostic.
- Create a new Firefox profile and see if the export function works in the new profile by trying to export the default bookmarks. If that works you can use the "Restore" feature of the Bookmarks Manager to choose one of the "bookmarks-(date).json" backups from the bookmarkbackups folder of the original Firefox profile folder, and then try exporting the restored bookmarks to an HTML file   If exporting bookmarks works in a new profile, the "places.sqlite" file in the original profile may be damaged (see below) or there may be other problems in the original profile (see the Firefox standard diagnostic for troubleshooting suggestions).
- Bookmarks and browsing history are stored in the Places database file "places.sqlite". If this file is damaged or missing certain bookmark entries, the export function will fail.  If you have a recent profile backup you can replace the original "places.sqlite" with the backup copy. If you have no backup or if it doesn't resolve the issue, you can force Firefox to create a new copy of places.sqlite and rebuild the Places database. Close Firefox completely, open the Firefox profile folder and remove (or rename) all files named "places.sqlite", including "places.sqlite.corrupt" files and "places.sqlite-journal", if found. When you next start Firefox, "places.sqlite" will be rebuilt and your bookmarks will be automatically restored from the most recent JSON backup (however, this will remove your browsing history of recently visited pages).  Note: You can force Firefox to rebuild the Places database using a bookmarks.html file, instead of the latest JSON backup, by following the instructions, including optional steps, outlined here.
If the above solutions do not help or if you would rather simply work around the problem for now, you can install the Foxmarks Bookmark Synchronizer extension. It will allow you to store your bookmarks on the Foxmarks site and download them to your computer as an HTML file, as explained here. (You can later rename the dated Foxmarks HTML file to "bookmarks.html", if needed.) 
Related bug reports
- Bug 437273 - bookmarks backup fails when bookmark record has no corresponding place record (Fixed in Firefox 3.5)
- Bug 457441 - Firefox will NOT Export bookmarks html file (Fixed in Firefox 3.5)
- Bug 457870 - Export Bookmarks to html does nothing if MozFox extension is installed
- Bug 469979 – Firefox 3.0.5 unable to export bookmark.html, the file can't be saved no matter where you try to save it.