Add comparison file and work with it

Hello, I m thinking about to buy your program, and testing a demo fersion. I have one issue I can’t to solve. My Excel program contains two files, one ms word and another ms Excel. Excel is the main file where I inpute values. Then by macros I export this values to Ms word document. All works great. Then if I compiled excel file to exe with add comparison file witch is my ms word file,macros can’t find ms word file inserted in exe… I tried to modify my code with yours xlspath function, but I can’t steel make my compiled exe find in himself added word file. If I add in the same exe file folder the original doc file, all works from exe, but Im trying to hide all my files in exe. Can you help me please?

part of code from excel

t = PathToFile("Договор оценка ТС.docx") Set WA = CreateObject("Word.Application") Set WD = WA.Documents.Add(t)

Hi Geo28,

From your code I see you are trying to open that file, I think once you compile that file needs to be referenced from the correct path, the XLSPadlock manual says the following;

“XLS Padlock offers an Excel function to retrieve paths to external files. This function is called PLEvalVar and can be called directly from Excel or with VBA code.”

I think you need to look at that function “PLEvalVar” for help.

I don’t have XLSP, but that looks like your problem, good luck.
Joe

Thanks for your answer, but I have already use this function PLEvalVar. PathToFile it is from it.
Public Function PathToFile(Filename As String) On Error GoTo Err Set XLSPadlock = Application.COMAddIns("GXLSForm.GXLSFormula").Object PathToFile = XLSPadlock.PLEvalVar("XLSPath") & Filename Exit Function Err: PathToFile = "" End Function

And it is doesnt work…in this part
`t = PathToFile(“Договор оценка ТС.docx”)
Set WA = CreateObject(“Word.Application”)
Set WD = WA.Documents.Add(t)

`

I tried many ways and this is my result:
If i add as a comparison file Excel workbook “Mybook.xlsx”,Then i can open it with this code from my exe compiled file
s = PathToFile("Mybook.xlsx") Workbooks.Open Filename:=s

Where PathToFile is function
Public Function PathToFile(Filename As String) On Error GoTo Err Set XLSPadlock = Application.COMAddIns("GXLSForm.GXLSFormula").Object PathToFile = XLSPadlock.PLEvalVar("XLSPath") & Filename Exit Function Err: PathToFile = "" End Function

If i add as a comparison file MSWord file “Test.docx”,Then i cant open it with this code from my exe compiled file
Set WA = CreateObject("Word.Application") WA.Visible = True t = PathToFile("Test.docx") WA.Documents.Open (t)

The error resumes here "WA.Documents.Open (t)"
Please can you help me to make this (or tell me another) methods (Documents.Open,Documents.Add) work from exe file…
It is very necessary for me and i think for your program to work with this methods, or change them to working one. Please help…

The Pathtofile function uses XLSPadlock.PLEvalVar(“XLSPath”) which returns the path to a virtual folder, so Word won’t be able to find your DOCX in that virtual folder.
What about using XLSPadlock.PLEvalVar(“EXEPath”) instead? This will return the path to the folder of the EXE file. This folder is accessible by Word.

If I use PLEvalVar(“EXEPath”) the macros cant open both Excel file “Mybook.xlsx” and “Test.docx” if they are located in compiled exe. But if I move them into the folder where the exe file is,macros can find and open them. But the goal is to hide them into exe container to prevent stealing them.
Maybe there is another constructions of code to get comparison MSWord files from exe?

The problem is that Word is not configured to find virtual files contrary to Excel. We could add the option but there might be compatibility problems…

Maybe you could do this:

  •      Use VBA to copy the DOCX file from the EXE container to a temporary location
    
  •      Do your comparison 
    
  •      Delete the DOCX file once it is done.

I cant make VBA to find or see DOCX in EXE container, so i cant “Use VBA to copy the DOCX file from the EXE container to a temporary location”((
I think there is some ways to solve this problem:

  • Make a function to fast decompressing files from EXE (MSWord or another problem files) and inserting them in temporary folder with result of this function as returning the path to this temporary folder, then we can work with this files in knowing temporary folders,and closing function which will delete temporary folder or save file in it and inserting it back to exe container,the closing function we can insert after our VBA code.
  • Make special functions or constructions of code to make VBA from EXE to see MSWord files. I think this solution is for advanced coders
    Please tell me your decision about this problem or upgrading XLSPadlock to solve this problem? Should we wait for any updates in the near future?
    Thanks.

With XLSPadlock.PLEvalVar(“XLSPath”), you should be able to access the DOCX file from Excel VBA if you add it as a Companion File with the feature in XLS Padlock. Then copying it should be possible with FileCopy.

Make a function to fast decompressing files from EXE (MSWord or another problem files) and inserting them in temporary folder with result of this function as returning the path to this temporary folder, then we can work with this files in knowing temporary folders,and closing function which will delete temporary folder or save file in it and inserting it back to exe container,the closing function we can insert after our VBA code.

It is possible but we can’t save back to EXE file for security reasons.

gdgsupport thanks you a lot. FileCopy works great, I cant use it before couse I dont know VBA very well. Problem solution is to copy DOCX file from EXE to some folder then work with it and then kill this DOCX file in decompressed folder how you say it to me.

And can you tell me how hard it is to break the EXE container, made by your programm, to get comparisons files? I know this is a stupid question but however,is it hard to hack the exe. I understand that all files can be hacked, but what are the time and level of knowledge to do this?

Sure everything can be cracked, it is just a matter of knowledge, resources and time. Feel free to contact us by email or with Message, and we can give you more info about the security of your comparison files.