Jump to content
Sign in to follow this  
cooper1967

File could not be created on this disk

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

To me, that doesn't look like a complete, valid, file path. Change the script to use get(desktoppath) and see if that works. 

Share this post


Link to post
Share on other sites

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.

Share this post


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.

Share this post


Link to post
Share on other sites

maybe this thread will help?

 

Share this post


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.

 

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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