Jump to content

File could not be created on this disk


This topic is 683 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to post
Share on other sites
  • 2 weeks later...

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

 

Link to post
Share on other sites
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:

  1. the path is invalid;
  2. you don't have write permissions in the selected folder;
  3. the disk is full.

 

Edited by comment
Link to post
Share on other sites

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 by LaRetta
Clarification on FMPro versus Pro Advanced
Link to post
Share on other sites
  • 3 weeks later...

Here is the code.

code2.jpg.da20cc4aa9de70c2bccdbd8b53da3d76.jpg

 

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 by cooper1967
Link to post
Share on other sites
  • 3 weeks later...

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.

Link to post
Share on other sites

This topic is 683 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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.