cooper1967 Posted September 27, 2018 Posted September 27, 2018 On laptop running FMP Pro 16 Advanced these two script statements result in List.xlsx saved in directory FMPstoredfiles Set Variable [$SavePath; Value "FMPstoredfiles/" & “List” & ".xlsx"] Export Records [with dialog:off;"$SavePath"; Unicode (UTF-16)] On client laptop running FMP Pro 16 the same statements result is “List.xlsx could not be created on this disk” The FMPstoredfiles directory is there, not full, and not locked. Using the file menu Export Records will save List.xlsx in the FMPstoredfiles directory. Both laptops run Windows 10. The only difference is Advanced vs plain FMP. I have run out of troubleshooting ideas. An Internet search found one person who thought the problem was font settings on their client PC, but they were saving a pdf file. Any ideas on how to make this work on the client laptop? I have access to it. Jim
Tom Assia Posted September 27, 2018 Posted September 27, 2018 Hey, The file List.xslx is not open anywhere ? Tom
cooper1967 Posted October 6, 2018 Author Posted October 6, 2018 Tom, No it's not open. When export in script fails to save the file, I can immediately use export in the menu and save the open records in a file named List.xslx.
bcooney Posted October 7, 2018 Posted October 7, 2018 To me, that doesn't look like a complete, valid, file path. Change the script to use get(desktoppath) and see if that works.
cooper1967 Posted October 8, 2018 Author Posted October 8, 2018 I initially used Get(path) to find the folder that the solution file was in and then added the FMPstoredfiles folder and file name. This resulted in the same error message. The FMPstoredfiles folder is a subfolder in the folder containing the solution file. The relative path should work and does work on my development laptop with FM Advanced. The exact same script doesn't work on another laptop with plain FM, not Advanced.
cooper1967 Posted October 8, 2018 Author Posted October 8, 2018 I just tried the $SavePath = "filewin:/C:/list.xslx" and $SavePath = "C:/List.xsls". Both get the “List.xlsx could not be created on this disk” error. It seems that the Export script step won't save the file no matter how simple the path is, yet the manual export using the menu will. At this point, I don't have any alternative other than message the client to use the menu steps to save the results. This makes me and FM scripting look brain-dead to the client.
cooper1967 Posted October 10, 2018 Author Posted October 10, 2018 Topic was a little hard to follow, but in the end I did this: Set Variable [$FileName; value:List.xslx"] Set Variable [$Path; value:"filewin:" & get(DeskTopPath) & $FileName used $Path in export . $Path was Filewin:/C:/Users/VAC Membership/Desktop/List.xlsx Got file "file could not be created...." error Then used Menu and Export Records to successfully save records on Desk Top appearing as an icon. Two things are frustrating; not being able to copy and paste script steps outside of FM, and feeling like I am hopelessly the only person in the world with this problem, but thank you for helping. When I tried $SavePath = "filewin:/C:/list.xslx" it seemed that I couldn't get more simple than that. Is there any information about the meaning of the "file could not be created..." error message? Is FM responding to a Windows error, or is it a FM error? Doing what the message says doesn't fix the problem.
comment Posted October 10, 2018 Posted October 10, 2018 (edited) 20 minutes ago, cooper1967 said: Is there any information about the meaning of the "file could not be created..." error message? AFAIK, it can mean one of three things: the path is invalid; you don't have write permissions in the selected folder; the disk is full. Edited October 10, 2018 by comment
LaRetta Posted October 10, 2018 Posted October 10, 2018 (edited) Hi Jim, Are you sure that the other laptop has the folder name FMPstoredfiles exact? Can you make sure there is not a space after the text? Because if you do, you will get that message (in versions prior to 17) because, as Comment points out, the path is invalid (including the folder name). Also check the script which creates the folder name (if you have one). If your script creates a folder name improperly then scripts writing to it properly would fail as well. With version 17, we now have an option in Export Records[] which allows us to create the directory if it doesn't exist. As last resort, it would be helpful if you provided the exact script (or at least screen captured the section on the export). We'll help you figure it out; hang in there. 😃 Updated: There is no difference between FMPro and FMPro Advanced when it comes to that and in fact, version 17 simply includes a checkbox in FileMaker > Preferences > General tab so the Developer can specify whether to allow the User to have advanced tools. Edited October 10, 2018 by LaRetta Clarification on FMPro versus Pro Advanced
cooper1967 Posted October 28, 2018 Author Posted October 28, 2018 (edited) Here is the code. This $SavePath works when used in the Export. The $ListName is saved in the solution's folder. All attempts to add a subfolder to the solution folder and save to it have failed. I give up and will instruct the client to find the result file in the solution's folder. Edited October 28, 2018 by cooper1967
LaRetta Posted November 15, 2018 Posted November 15, 2018 Hi Jim, I had not received an email of your response! Again, the error is probably in the path name. Please paste the exact result string of $SavePath here. Get ( FileName ) might be your problem but we need to see the resulting string.
Recommended Posts
This topic is 2534 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now