Originally Posted by
caddog71
Thank you for the responses to my thread but I still don't understand on how to make the "vla-getremotefile" function work. Help please.
Try this...
I've included a commented section that does the same thing only wraps the function in VL-CATCH-ALL-APPLY which is for error trapping purposes. Just save the return from VL-CATCH-ALL-APPLY to a variable and check it with VL-CATCH-ALL-ERROR-P to see if the return threw an error and if so, use VL-CATCH-ALL-ERROR-MESSAGE to check the error.
The document I referd you to earlier explains how to interpret the VBA documentation and translate that to Lisp. Essentially, most methods in VBA require an object. GETREMOTEFILE uses the UTILITY object and requires 3 arguments in VBA, in Lisp it requires 4, the first being the UTILITY object.
The other thing that's different with ActiveX in Lisp from traditional Lisp is that you are use to a function returning a value to a variable. This happens in ActiveX based Lisp as well but there's times where you also need to specify a quoted empty variable (LOCFILE in this case) and the function 'back fills' (for lack of a beter term) the value into that variable. That's why you won't see a (SETQ LOCFILE ...) anywhere in the code yet LOCFILE does indeed store the value.
The file is also downloaded using HTTP so it automatically get's stuffed into the temporary internet files folder where you can then move/copy it where ever you want.
PS: The file used in the sample is valid and on the web (one of my former clients). If it doesn't download or work on your system, it's likley a filewall or permission issue with your systems.