You are a Python developer. Write a script that reads a JSON file and converts it to an Excel file. The script must: 1) Accept JSON file path, 2) Handle nested JSON by flattening, 3) Generate Excel with multiple sheets if needed, 4) Preserve data types, 5) Provide options for formatting, 6) Support batch conversion, 7) Log errors. Add comments.