I'd look at using Win APIs to get that path. SHSPECIALFOLDERS in the vfp2c FLL 
wraps that for you.

SET LIBRARY TO vfp2c32.fll
m.specialPath=[]
?SHSPECIALFOLDER(0x0005,@specialPath)
?m.specialPath

Some Windows API header file has all the values for that first parameter. 

--

rk

-----Original Message-----
From: ProfoxTech <profoxtech-boun...@leafe.com> On Behalf Of MB Software 
Solutions, LLC
Sent: Tuesday, April 6, 2021 1:56 PM
To: profoxt...@leafe.com
Subject: Interesting Error 1426 on COPY TO (lcFile) FIELDS a, b, c FOR 
condition TYPE XL5

I get this error when executing a COPY TO .... TYPE XL5 line in a program 
designed over a decade ago: /OLE error code 0x80030003: Unknown COM status 
code. /

Interesting. I remoted into the guy's computer.  He said it's a fairly new 
laptop (3 months old?) and it's version is 2102 (Build 13801.20360).  I fired 
up vRunFox.exe and did a simple xx =
CREATEOBJECT("Excel.Application") and it worked fine.  What's strange to me is 
that the line throwing that Error 1426 is not an Excel automation line, but the 
COPY TO line.  I believe the problem is the lcFile variable.  When this code 
was written, Vista was the latest operating system.  You can see how I look at 
the OS() to select the proper area for My Documents.

                *** mjb 03/03/2010 - changed for Vista and beyond
                IF VAL(SUBSTR(OS(),9,1)) >= 6 THEN && Vista doesn't use My
                        lcDir = SYS(5) + ADDBS(GETENV("HOMEPATH")) + 
"Documents\"
                ELSE && XP and below use My
                        lcDir = SYS(5) + ADDBS(GETENV("HOMEPATH")) + "My 
Documents\"
                ENDIF   
                lcFile = ADDBS(lcDir) + "Inventory_" + DTOC(DATE(),1)
                *** mjb 06/26/2017 - added nbrdft, ntotbf
                IF this.lShowZeroQty THEN
                        COPY TO (lcFile) FIELDS ccompany, cpalletsize, 
cdescription, nqtyonhand, nprice, ntotvalue, nbrdft, ntotbf FOR 
this.CustomerSelected(icustid) TYPE XL5
                ELSE
                        COPY TO (lcFile) FIELDS ccompany, cpalletsize, 
cdescription, nqtyonhand, nprice, ntotvalue, nbrdft, ntotbf FOR 
this.CustomerSelected(icustid) AND nQtyOnHand > 0 TYPE XL5
                ENDIF

So in short, I think the fact that it's Error 1426 is misleading...I doubt it's 
an Excel problem at all but in fact a problem with that lcFile actual path 
derived.

I think somebody recently mentioned a Doug Hennig bit of code to look at the 
user's ACTUAL path to his documents area, iirc?  I'll dig for that later after 
an appt but wanted to throw this out there in the meanwhile in case others have 
the "I had that happen to me and this is how I fixed it!" kind of memory 
recall.  ;-)

tia,
--Mike




--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/c74e20a6-e5fd-9cb0-07f4-7ee1bdf56...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.
Report [OT] Abuse: 
http://leafe.com/reportAbuse/c74e20a6-e5fd-9cb0-07f4-7ee1bdf56...@mbsoftwaresolutions.com
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/mwhpr1001mb21449d9e610341dbe2bfe48dd2...@mwhpr1001mb2144.namprd10.prod.outlook.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to