[Ma...] Posted June 18 Share Posted June 18 Hello everybody, We are trying to automate our Zeiss and we need to automatically upload our excel file to our servers. I can not find a way to directly save the excel files to the servers. Can anyone help me on this? Thanks in advance Link to comment Share on other sites More sharing options...
[Ma...] Posted June 18 Author Share Posted June 18 Just to add one more point, it has save automatically to the location and the excel file should close automatically as well for us to upload to our system. Where do I put macros to directly close the excel file? Thank you Link to comment Share on other sites More sharing options...
[Ch...] Posted June 18 Share Posted June 18 By default CALYPSO always outputs excel to the default results folder. This can be set via Extras > Settings > Environment > Paths > Default Path for Result Files. However excel output files are a bit unique in that CALYPSO doesn't has a built in function to have only excel files go to a different directory other then the default (like say a PDF). Because of this the only way to have CALYPSO move excel files to a folder other than the default results folder is to use PCM or a batch file. PCM requires you to have the license where as batch files don't. To learn how to use batch files to move excel outputs individually have a look at CALYPSO: Batch File Automation Guide. The code will end up looking something like this but I'm sure it can be improved as well: @ECHO OFF timeout /t 10 taskkill /f /im Excel.exe timeout /t 5 move "C:\Users\Public\Documents\Zeiss\CALYPSO 8.0\workarea\results\*.xlsx" "Z:\CALYPSO results\Excel Results" Link to comment Share on other sites More sharing options...
[Ni...] Posted June 19 Share Posted June 19 Can the naming convention for the Excel output file be changed? I'd like to add more info than just the measurement plan name _(&)_ incremental part number to the file name. Link to comment Share on other sites More sharing options...
[Ri...] Posted June 19 Share Posted June 19 I think it's based off the name of the Table Files, so yes you'd need to set this up in Resources - Name for Output Files. Here are a couple of articles on changing the output paths/naming. https://portal.zeiss.com/knowledge-base?id=587888 https://portal.zeiss.com/knowledge-base?id=1668954 Link to comment Share on other sites More sharing options...
[DW...] Posted June 19 Share Posted June 19 (edited) Please sign in to view this quote. Please sign in to view this username. Use task scheduler and a PowerShell script to close all open instances of Excel and then move the files from the default XLS location to your servers once an hour/day/week. The script would look like this - # First, stop all running Excel processes Get-Process -Name "EXCEL" -ErrorAction SilentlyContinue | ForEach-Object { try { Stop-Process -Id $_.Id -Force -ErrorAction SilentlyContinue Write-Host "Closed Excel process with ID $($_.Id)" } catch { Write-Warning "Failed to close Excel process with ID $($_.Id): $_" } } # Define the source directory to search for XLS files $sourcePath = "C:\Path\To\Source\Folder" # Define the destination directory on the server $destinationPath = "\\ServerName\SharedFolder\Destination" # Ensure the destination directory exists if (!(Test-Path -Path $destinationPath)) { New-Item -ItemType Directory -Path $destinationPath -Force | Out-Null } # Get all .xls files in the source directory and its subdirectories $xlsFiles = Get-ChildItem -Path $sourcePath -Filter *.xls -Recurse -File foreach ($file in $xlsFiles) { try { # Construct the destination file path $destFile = Join-Path -Path $destinationPath -ChildPath $file.Name # Copy the file to the destination Copy-Item -Path $file.FullName -Destination $destFile -Force Write-Host "Copied: $($file.FullName) to $destFile" } catch { Write-Warning "Failed to copy $($file.FullName): $_" } } Edited June 19 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in