Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can not save the document #13

Open
mxmx7 opened this issue Jan 12, 2017 · 9 comments
Open

I can not save the document #13

mxmx7 opened this issue Jan 12, 2017 · 9 comments

Comments

@mxmx7
Copy link

mxmx7 commented Jan 12, 2017

hello, please help. I did everything so as you wrote.after generating the code macro, and inserting it in a word I can not get it save the document. I tried everything, I do not know what the error. I changed to the Private Sub Document_Open, I have installed pefile, I use VM win7pro 32bit and Microsoft Office 2016.

needs your program

please help

@khr0x40sh
Copy link
Owner

Can you paste the Macro code here or on pastebin and provide the link? Thanks.

@mxmx7
Copy link
Author

mxmx7 commented Jan 18, 2017

Thanks for the answer
command: python exeinvba.py --exe putty.exe --out putty.vb

http://wklejaj.pl/GYQ9EdyPPAXX


command: python exeinvba.py --exe putty.exe --out putty.vb --dest C:\Users\admin\Downloads\MacroMaster\putty.exe
(putty is located in folder MacroMaster)

http://wklejaj.pl/1XWmDyS9cwXX
pastebin only has a 512 kb limit

@khr0x40sh
Copy link
Owner

khr0x40sh commented Jan 18, 2017

[EDIT]: Another solution to your specific problem, but there is a cap on how large the file can be. Putty should be ok as I have used this to transfer putty before.

Your --dest variable should have the backslashes doubled up. Try that and see if it works (e.g C:\\Users\\Public\\Downloads\\test.exe)

There is a limit on how large a macro can be. Two parts of the problem:

  1. The length of a variable is limited to 64K (http://stackoverflow.com/questions/10927764/vba-string-limit)
  2. The length of continuous lines before the sub main appears to be limited to 1400 or so lines http://excelribbon.tips.net/T010449_Maximum_Length_Limit_for_a_Macro.html

I will add this to bugfix and see if I can come up with a solution for larger binaries, but things under 1 MB should easily be under the cap.

@khr0x40sh
Copy link
Owner

Also, the code won't create the directory on the machine the macro is run on. So the destination path will need to exist prior to executing the macro (not sure if that's the case with the second paste or not, but something to keep in mind).

If after attempting these workarounds, you are still having issues, please let me know.

@sevagas
Copy link

sevagas commented Oct 17, 2017

Hi, I added the exeinVBA feature in https://github.com/sevagas/macro_pack (EMBED_EXE template)
I am also struggling with > 1mega exe pbs. I will tell you when I find the solutions.
Regards,
Emeric

@khr0x40sh
Copy link
Owner

I've been testing with adding the content in chunks to the cells of the excel and then having the Macro read those in and piece the file together that way. Haven't figured out all the bugs yet, but it looks promising. Might be worth a shot for you to try as well as I am swamped with other things and may be some time before I finish.

Thanks for the head's up.

@sevagas
Copy link

sevagas commented Oct 27, 2017

I am looking into another solution, generate multiple VBA modules to avoid the 64k compiled code module size limit. But I face another problem. It seems some base 64 representation is not accepted by VBA, even on very small file. I have no clue why

@praveenyadav1602
Copy link

It seems some base 64 representation is not accepted by VBA, even on very small file. I have no clue why?

not a programmer like you, but i am also searching solution for this from last few days

@khr0x40sh
Copy link
Owner

khr0x40sh commented Oct 30, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants