Recent

Author Topic: [SOLVED] TSaveDialog  (Read 574 times)

Zvoni

  • Hero Member
  • *****
  • Posts: 3435
Re: [Reopened] TSaveDialog
« Reply #15 on: June 18, 2026, 10:22:07 am »
It's getting weirder and weirder

Minimal code (Form, Button)
Code: Pascal  [Select][+][-]
  1. Uses LCLIntf;
  2. procedure TForm1.Button1Click(Sender: TObject);
  3. begin
  4.   OpenDocument('C:\Users\zvoni\OneDrive - CompanyName Group\Dokumente\5009.xlsx');
  5. end;      
Works......
*confused*
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Zvoni

  • Hero Member
  • *****
  • Posts: 3435
Re: [Reopened] TSaveDialog
« Reply #16 on: June 18, 2026, 10:25:13 am »
"... add/remove ..."

Something like this:

Code: Pascal  [Select][+][-]
  1. SaveDialog1.Options := SaveDialog1.Options - [ofFileMustExist, ofOverwritePrompt, ofAutoPreview] + [ofNoValidate, ofNoTestFileCreate];
Nope.
Still getting EFCreateError (see screenshot)

I'm even thinking it might be a Company-Policy in Windows Defender...*sigh*
Something like "No Saving from unknown Software on Sharepoint" or something like that
« Last Edit: June 18, 2026, 10:27:20 am by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Xenno

  • Full Member
  • ***
  • Posts: 131
    • BS Programs
Re: [Reopened] TSaveDialog
« Reply #17 on: June 18, 2026, 10:36:09 am »
Something like "No Saving from unknown Software on Sharepoint" or something like that

Exactly. Check the folder is folder *cloud* or local using the code above. When the folder is not local, give message and cancel.
Lazarus 4.6, Windows 10, https://www.youtube.com/@bsprograms
If I want to share, I give. If I want money, I sell. I don't set traps.

Zvoni

  • Hero Member
  • *****
  • Posts: 3435
Re: [Reopened] TSaveDialog
« Reply #18 on: June 18, 2026, 10:41:36 am »
Something like "No Saving from unknown Software on Sharepoint" or something like that

Exactly. Check the folder is folder or local using the code above. When the folder is not local, give message and cancel.

But i AM using the "local" Folder
"c:\Users\Zvoni\OneDrive - CompanyName\Dokuments\5009.xlsx", and it fails with EFCreateError, even without a SaveDialog, just passing the FileName to my FileStream for saving
and that folder definitely exists, since i tested it with a testfile for Reading (!!)
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Xenno

  • Full Member
  • ***
  • Posts: 131
    • BS Programs
Re: [Reopened] TSaveDialog
« Reply #19 on: June 18, 2026, 12:21:37 pm »
Last check: Can you copy a file into that folder using the same account?

It could be related to permission, OneDrive synchronization, or company policy issues.
Lazarus 4.6, Windows 10, https://www.youtube.com/@bsprograms
If I want to share, I give. If I want money, I sell. I don't set traps.

Zvoni

  • Hero Member
  • *****
  • Posts: 3435
Re: [Reopened] TSaveDialog
« Reply #20 on: June 18, 2026, 12:33:33 pm »
Thx to everyone who tried to help

I've found the culprit.

It's Windows-Defender
In the Ransomware-Protection, the 3 OneDrive-Folders i was testing with (Documents, Pictures, Desktop) are protected.
Could even see it in the Access-History.

Though i have to say, the Error-Message sent us on a merry chase....

*sigh*....now i have to negotiate with IT-Department....
this is going to be fun....
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018