PDA

View Full Version : Xlsm file problem



Stefano
10-21-2020, 04:54 AM
Hi everybody,
I have a very annoying problem.

On our server we have several folders with technical data sheets, they are all .xlsm files with macro and activeX buttons inside (made by me, excel 2013).
They are all very similar, and filesize is about ~230kb per file.
We are working on them since some years, and everything had gone fine until some days ago.
We have all win10 64 and excel 2013.

Here is what has been happening for a few days:

If I open a file on a pc other than mine: no problem, the file opens perfectly, and saves without any problem, mantaining its size.


If I open the same file on my pc by double clicking on file name: I can see Excel welcome screen "opening file bla bla bla.xlsm....", then everything disappear and excel closes.
Now if I open excel by double clicking on program icon... it opens my file in recovery mode, with activeX controls disabled.


If I open excel, and then open my file by open command, it opens fine.
But... if I now save it, its size is reduced to something about 75 kb.

Now, if I open the same file just saved on my pc (75kb) on another pc by double click... welcome sceen, opening bla bla bla... close.
And if I open excel by double clicking on program icon... it opens my file in recovery mode, with activeX controls disabled.



Instead if I open Excel and then the file (75kb) it opens fine.
And if I save it is still ~75kb.



Magic trick, now if I open the same file back on my pc from within excel or by double clicking....excel shows welcome screen and then closes!


Ok, re-reading it is quite a mess, but the meaning is that I have a problem which I cannot solve. :banghead:
I tried a lot of different solutions, also a deep recover of Office, but nothing worked.

Any idea...?

mancubus
10-21-2020, 06:00 AM
hi.
the only thing i can recommend is to take a look at this page:
https://www.jkp-ads.com/articles/startupproblems.asp?AllComments=True

Paul_Hossler
10-21-2020, 08:38 AM
I've found that Rob Bovey's code cleaner can solve a lot of that sort of thing

Worth a try

http://www.appspro.com/Utilities/CodeCleaner.htm

It only works with 32 bit office, but you can manually export / import if you have to

Stefano
10-22-2020, 07:48 AM
Tryed everything, nothing works! :crying:


I've found that Rob Bovey's code cleaner can solve a lot of that sort of thing
Worth a try
http://www.appspro.com/Utilities/CodeCleaner.htm
It only works with 32 bit office, but you can manually export / import if you have to

Sorry, but I did not understand how to and where import (and what...)

I will try to completely uninstall and reinstall office... and if this does not work as well... do I really have to reinstall Win???

Paul_Hossler
10-22-2020, 09:22 AM
Look at #12 in

http://www.vbaexpress.com/forum/showthread.php?67929-VBA-conks-out-on-very-simple-code



You did try to repair Office, but I doubt that reinstalling Windows would help

If you want, post the troublesome file here and people will try to see if there's any visible issues


Are you running 64 bit or 32 bit Office? What about the other people?

Stefano
10-23-2020, 05:18 AM
Hi Paul,
everyone here in running Office 2013 64 bit on Win10 Pro.

I just tried to clean code with Ribbon commander, it reduced file size, ok, but the problem still persists.

Here I upload a zip file containing a my files.
I cannot upload a single file without modifying all references in my macro, sorry. Thi is basically the tree:


DATASHEET TEST
[*=1]DataBase
[*=2]SCHEDE_v3.xlam.................................................xlam file containing macroes
[*=1]PDF - ORDINI..............................................................auto saved PDF of orders
[*=2]2020
[*=3]CUSTOMER_1
[*=1]PDF - SCHEDE CLIENTE................................................auto saved PDF of customer sheets
[*=2]CUSTOMER_1
[*=1]PDF - SCHEDE TECNICHE..............................................auto saved PDF of data sheets
[*=2]CUSTOMER_1
[*=1]SCHEDE
[*=2]CUSTOMER_1
[*=3]DS00000010 - Test Datasheet 10.xlsm...........actual files to work on
[*=3]DS00000011 - Test Datasheet 11.xlsm
[*=3]DS00000012 - Test Datasheet 12.xlsm
[*=3]......


File DS00000010 - Test Datasheet 10.xlsm have 3 sheets with activex buttons:


SCHEDA TECNICA
[*=1]"RESET" will execute startup code
[*=1]"MODIFY DATA" will open a dialog where to modify basic datasheet data
[*=1]"FILL DATA" will open a dialog and then give you an error, because I did not attach material database
[*=1]"ORDER" will open a dialog to fill a order
SCHEDA PREZZO
[*=1]"MANUFACTURE FILL" will open a dialog and then give you an error, because I did not attach manufacturing database
SCHEDA CLIENTE
[*=1]"CUSTOMER SHEET" will open a dialog and then give you an error, because I did not attach material database


Obviously it is necessary to add a reference to SCHEDE_v3.xlam.

It is really possible that you will find strange code... I'm not a coder at all, and I learned vb some years ago by doing this project... so be gentle! :)

Stefano
10-30-2020, 02:06 AM
So... no idea?

snb
10-30-2020, 02:45 AM
Check in the VBEditor in the tab Extra, the option 'references'.
Probably one or more is/are missing.

Avoid protection in VBA.
Avoid Application.enableevents=false
Avoid public variables