105 lines
3.9 KiB
Markdown
105 lines
3.9 KiB
Markdown
# SharePoint XLS to XLSX Converter
|
|
|
|
This tool allows you to convert legacy `.xls` files stored in SharePoint to the modern `.xlsx` format. The converter maintains the original folder structure and automatically uploads the converted files back to SharePoint.
|
|
|
|
## Installation Instructions
|
|
|
|
### Step 1: Install PowerShell 7.5
|
|
|
|
**Option 1: Manual Installation**
|
|
1. Visit the [PowerShell GitHub releases page](https://github.com/PowerShell/PowerShell/releases)
|
|
2. Download the appropriate installer for your system (e.g., `PowerShell-7.5.0-win-x64.msi` for 64-bit Windows)
|
|
3. Run the installer and follow the on-screen instructions
|
|
|
|
**Option 2: Install using winget (Windows 10/11)**
|
|
1. Open a command prompt or PowerShell window
|
|
2. Run the following command:
|
|
```
|
|
winget install --id Microsoft.PowerShell
|
|
```
|
|
|
|
**Option 3: Install using PowerShell script**
|
|
1. Open Windows PowerShell as administrator
|
|
2. Run the following commands:
|
|
```powershell
|
|
# Download the installation script
|
|
Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile install-powershell.ps1
|
|
|
|
# Install PowerShell 7.5
|
|
.\install-powershell.ps1 -UseMSI -Quiet
|
|
```
|
|
|
|
4. Verify the installation by opening PowerShell 7 from the Start menu
|
|
|
|
### Step 2: Install Required Dependencies
|
|
|
|
1. Download the XLS to XLSX Converter files to a folder on your computer
|
|
2. Right-click on PowerShell 7 in the Start menu and select "Run as administrator"
|
|
3. Navigate to the folder containing the converter files:
|
|
```
|
|
cd C:\path\to\SharepointXLS_to_XLSX
|
|
```
|
|
4. Run the dependency installer script:
|
|
```
|
|
.\Install-Dependencies.ps1
|
|
```
|
|
5. The script will install the required Microsoft Graph modules and verify that Excel is installed
|
|
|
|
### Step 3: Configure Microsoft Graph Authentication
|
|
|
|
1. The first time you run the application, you'll need to authenticate with Microsoft Graph
|
|
2. Follow the prompts to sign in with your Microsoft 365 account that has access to the SharePoint site
|
|
|
|
## Operating the Program
|
|
|
|
### Starting the Application
|
|
|
|
1. Open PowerShell 7 as administrator
|
|
2. Navigate to the application folder:
|
|
```
|
|
cd C:\path\to\SharepointXLS_to_XLSX
|
|
```
|
|
3. Run the application in STA mode:
|
|
```
|
|
pwsh -STA -File .\MainForm.ps1
|
|
```
|
|
|
|
### Using the Application
|
|
|
|
1. **Configure SharePoint Settings**:
|
|
- Enter your SharePoint site URL (e.g., `https://yourcompany.sharepoint.com/sites/yoursite`)
|
|
- Enter the document library name (e.g., `Shared Documents` or `Documents`)
|
|
- Click "Save Config" to save these settings for future use
|
|
|
|
2. **Connect to SharePoint**:
|
|
- Click the "Connect" button to authenticate with SharePoint
|
|
- Follow any authentication prompts that appear
|
|
|
|
3. **Select a Folder** (Optional):
|
|
- Click "Browse" to navigate to a specific folder in SharePoint
|
|
- If no folder is selected, the application will work with files in the root of the document library
|
|
|
|
4. **List XLS Files**:
|
|
- Click "List XLS Files" to find all `.xls` files in the selected location
|
|
- The files will be displayed in the grid at the bottom of the window
|
|
|
|
5. **Convert Files**:
|
|
- Click "Convert to XLSX" to begin the conversion process
|
|
- The application will:
|
|
- Download each `.xls` file
|
|
- Convert it to `.xlsx` format using Excel
|
|
- Upload the converted file back to the same location in SharePoint
|
|
- Progress and status messages will appear in the text box on the right
|
|
|
|
## Troubleshooting
|
|
|
|
- **Authentication Issues**: Ensure you have the correct permissions to access the SharePoint site
|
|
- **Excel Errors**: Make sure Microsoft Excel is installed and properly licensed
|
|
- **File Access Errors**: Check that you have permission to read and write to the SharePoint libraries
|
|
- **Conversion Failures**: Some very old or complex Excel files may not convert properly
|
|
|
|
## Notes
|
|
|
|
- The application requires an active internet connection
|
|
- Large files may take longer to download, convert, and upload
|
|
- The original `.xls` files remain unchanged in SharePoint |