Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2012, 02:53 AM
Matris Matris is offline Incompatibility Excel VBA 2007/2010 Windows 7 64bit Incompatibility Excel VBA 2007/2010 Office 2007
Novice
Incompatibility Excel VBA 2007/2010
 
Join Date: Oct 2012
Location: Germany
Posts: 1
Matris is on a distinguished road
Default Incompatibility Excel VBA 2007/2010

Hi everybody!
I have a project that was created in Excel 2007. In the modules there are many constant declarations (private) with encrypted texts.
In Excel 2007 the project runs perfect.
If it opened in Excel 2010, then the error message "An error occured while loading XYZ. Do you want to continue loading the project?"
If I continue with "Yes" then missing large parts of the module "XYZ" - they are cut off, and that ALWAYS within the constant declaration area (in the head of each modul).

The same happens in the opposite direction (2010 -> 2007)

It always missing entire lines, never parts of it.

Does anyone know of this problem or someone has an idea on what to do?

It is important, because it is an commercial project...

Thanks for help and ideas!


Matris
Reply With Quote
  #2  
Old 10-12-2012, 12:08 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Incompatibility Excel VBA 2007/2010 Windows 7 32bit Incompatibility Excel VBA 2007/2010 Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Can you give an example of one of the constant declarations which is being removed between versions?
__________________
Colin

RAD Excel Blog
Reply With Quote
  #3  
Old 10-12-2012, 02:03 PM
Paul Cain Paul Cain is offline Incompatibility Excel VBA 2007/2010 Windows 7 64bit Incompatibility Excel VBA 2007/2010 Office 2007
Novice
 
Join Date: Oct 2012
Location: Australia
Posts: 6
Paul Cain is on a distinguished road
Default

Hi Colin

If I could give you an example as I am working with Matris on this:

Private Const gJAyzhMlkudo = "z0Ê®¥Å*Ÿ*éò„þ ©£¼²7GT@e¥B", mScMDpMZf = "+Õ¤qE¤b¥v.±t{»½åpÃî ¦W{~€ÐKrmM™ÊìòÓ©Y¿Éq*Ñ*çW’kØâcy°»Ê.¦±¢v‡kÏJ<Xûn$É, ¢iö5+îÒ¼¶Kï²þ", pSkjDhmMpelEEXIoGKcznvw = " ÉÐsRaß*N*œZ=D³G£¡“©Œ", KgMfEPYbo = "I½×*óâµw\Œ0'°ˆ}#UGÄ-A©Ž»t#ÕÐ_wÝ–*¸ H'ÃÍ£Ê}mŠ_„9åÕŒ¡ÙÅ3%Ä….CK)±cåö’ØJu1gÛÜ", BhHVaDeOhlhPQpRmlcYYWBUknI = "÷fÞÞx*Î&`zNΩŸ¤Ã)ÈÞ¹fL¨XØáºÅ¦ð6G$ùYõȵôPŠûîoÀÕG2ƒ ÊÖg1¿¬‹à~?‡c°‰âMëÈ û3‹Ëç(?áøCTƒC", kIkzUiqIdMzHXQs = "E¾ÈAŽ)HèÅÃM± ‘Z\sJ©xÞ.îâP–ÎÁˆ$ å*Ô(f:¤J_Qñ¥lÒ×u:SR´ªÏ-.ð", eKVeycLwtKRab = "J-¤€Ø8v¾ÈÑA`*/)~°¡2–+<¼¦5a²ó4oÕzÅ“…{", IDFY = "8`䜌5‚ŸC•ôëª88‚‚]{þr^‘Ó]!\*d ú", lpWG = "OýÒÖÂzƒn}…3yB¼}*I$¤ –CêÑËß%!Düõù.", yQleYRPIDsHmQYYYOPDoNngUlrT = "l7{^F;ÕhKµÒäñl¿ÓË®¢±H™ˆUe¼ìê¡‚#à*½!2Ôšõ…ìX^äºàÀ> M³§A ü³Š&=›VIç%¥ö", smbLlRNjeRsUGtwTtpA = "~0…W@—¤ÖL¼…ៗ2Çî:Ü°NŠ°F>˧FÁBGÒºš ô/?7qÒzÝj;Öñjšß*ºÄc®ié*µÁ»›<ïYë½=·<Û»×ü!K™,Âßç¨fEÖõò 0ùÙì›’”ÑÕýTL¾mDEU½rí¿7ˆÂð‹Q·U•Ïƒ*ö)ú#á{?k€„ë–šœíM‚ üý1¨IÉQòaæ£åÒÑ"

There are 907 characters (including spaces) in this particular line, which is typical, maximum was 935.
29 out of 56 modules have similar lines at the start.
Only 4 of these modules will not load, the same 4 whether I create the modules in 2007 and move the program to 2010 or in reverse order.

I have since done a test in which I split these lines in half to reduce their length and this makes no difference (tested with 1 module only, 2007 to 2010).

I have also remmed out the lines in another module and this made no difference (again tested with 1 module, 2007 to 2010).

In these most recent tests, all that appeared in these 4 modules that faulted was 1 remmed line, Option Explicit, then nothing or the first of the lines like the above example.

After these latest tests, it does not appear that these lines in themselves are the reason.

Earler tests tried to isolate a portion of the code which when moved or remmed allowed the module to load. In these tests, the offending code was moved to a new module and worked perfectly, but it appeared that a problem would then appear in a different module altogether!

At this stage, I am therefore at a loss to know what the problem is and don't know where to look next.

Any suggestion?

Thanks
Reply With Quote
  #4  
Old 10-12-2012, 02:26 PM
Paul Cain Paul Cain is offline Incompatibility Excel VBA 2007/2010 Windows 7 64bit Incompatibility Excel VBA 2007/2010 Office 2007
Novice
 
Join Date: Oct 2012
Location: Australia
Posts: 6
Paul Cain is on a distinguished road
Default

I should have added the following as it may be relevant:

I create a program in a machine with Excel 2007 and move it to a machine with Excel 2010.

I open it in 2010 and 4 modules do not load correctly.

From within 2010, I remove each of these 4 modules and import replacement bas modules.

I save and close the program and thereafter it works perfectly in 2010, on this and other machines with 2010.

I move it back to 2007 and these same 4 modules will not load.

thanks
Reply With Quote
  #5  
Old 10-13-2012, 02:41 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Incompatibility Excel VBA 2007/2010 Windows 7 32bit Incompatibility Excel VBA 2007/2010 Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi,

Good news (of sorts)...

I created a new workbook in XL 2010 (32-bit), added that constant and saved as an xlsm. I then opened it in XL 2007 and the constant was still there. I saved the file in 2007 and then opened it in 2010 again and the constant was still there.

Can you give me a couple more to experiment with to see if I can reproduce the problem? Unfortunately I don't have XL 2010 64-bit so I can't test with that.
__________________
Colin

RAD Excel Blog
Reply With Quote
  #6  
Old 10-13-2012, 01:46 PM
Paul Cain Paul Cain is offline Incompatibility Excel VBA 2007/2010 Windows 7 64bit Incompatibility Excel VBA 2007/2010 Office 2007
Novice
 
Join Date: Oct 2012
Location: Australia
Posts: 6
Paul Cain is on a distinguished road
Default

Hi Colin

I have attached an xlsm file with 1 module. It was created in Excel 2007 64 bit by importing the attached bas module. This file will open in Excel 2007 but the module will not load into Excel 2010 64 bit.

With 2010 open open, the bas file can be imported.

This should demonstrate the problem well, but you will not want to try and understand the code as it has been obfuscated. For this particular module, only Option Explicit is loaded in 2010.

thanks
Attached Files
File Type: zip 1 Module created in 2007.zip (60.0 KB, 12 views)
Reply With Quote
  #7  
Old 10-14-2012, 03:30 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Incompatibility Excel VBA 2007/2010 Windows 7 32bit Incompatibility Excel VBA 2007/2010 Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

I opened the file without problem in Excel 2010. I'm using 32-bit Excel 2010 on 32-bit Windows 7 though. My guess is this problem relates to the fact that you're using Excel 2010 64-bit and Excel 2007 32-bit. (There isn't a 64-bit version of Excel 2007).

If you are using 64-bit Office 2010 (double check this by going File > Help), the first thing to do is ensure that your code transfers and runs well between the two versions when it is not obfuscated. From there, the best suggestion I can make is that you approach the vendor (crunchcode) of the obfuscator you're using. You've paid them money to use their software so they should be able to advise and support you on why this is happening. I looked on their website and one of the FAQ they answer is the situation where large portions of code, particularly constants, are not loaded - so they are familiar with this sort of problem.

You guys must be putting together something pretty special to make it worth your while to obfuscate your VBA code. At the conclusion of your project I'd be very interested to hear how you've found the whole experience (this issue aside), since I've never done it myself.
__________________
Colin

RAD Excel Blog
Reply With Quote
  #8  
Old 10-14-2012, 01:41 PM
Paul Cain Paul Cain is offline Incompatibility Excel VBA 2007/2010 Windows 7 64bit Incompatibility Excel VBA 2007/2010 Office 2007
Novice
 
Join Date: Oct 2012
Location: Australia
Posts: 6
Paul Cain is on a distinguished road
Default

Thanks Colin

Its good to know it is OK with 32 bit Excel 2010 - I had assumed the incompatibility was Excel 2007/2010; It seems it is Excel 32/64 bit

<<Correction: I incorrectly assumed Excel 2010 was 64 bit. It is 32 bit. Subsequent tests with other machines with Excel 32 bit and Windows 7 64 bit all had the same problem. Conclusion is that it appears to be a problem with Excel 2007/2010 (32 bit) compatibility>>

There is no problem when not obfuscated.

To answer your question, I have spent about 3 years on this project, so I wanted some protection. I have had to spend a few months writing code associated with hardware/software keys before obfuscating the program. I am very happy with the obfuscation. It is a serious deterrent - to attack the program would be very frustrating. The software has a small market, so I do not think it would be worth anyone's effort to attack it.

Thanks for your help

Last edited by Paul Cain; 10-16-2012 at 04:11 AM. Reason: Correct an error
Reply With Quote
  #9  
Old 10-15-2012, 12:54 AM
Volker Frank Volker Frank is offline Incompatibility Excel VBA 2007/2010 Windows 7 64bit Incompatibility Excel VBA 2007/2010 Office 2010 32bit
Novice
 
Join Date: Oct 2012
Posts: 1
Volker Frank is on a distinguished road
Default same problem encountered in PowerPoint 2007 / 2010, both 32 bit

Hi all,

not sure whether 32/64 bit is the right direction to go. I had the same problem with PowerPoint and it seemed to have been a problem with const not being declared private (where possible). I do have (public) const in my project and they work. Only additional constants that were added later and used only in the respective modules seem to have caused the trouble. Maybe 64 bit is only aggravating a different cause?

Quite weird: you test, compile and save the project in either version (2007/2010) and you cannot open it with the other without code being dismissed. Always the same module(s), different starting lines though. And the other modules had constants added later, too. So why do some modules fault while others don't? And why consistently the same modules? (Though I have to admit having had variations such that two modules faulted at the beginning. After I had restructured the project to isolate code only one module faulted. However after implementing test results (only minor changes), another module started to fault, too. Ever since it had been these two modules and after declaring constants private whereever possible, I was able to open the project in both PowerPoint versions crosswise. Luckily! I hope this is a stable solution ;-)

As the code is working fine in both versions of PowerPoint, I would not have expected any incompatibility if that's the right word to use for this trouble. So how does PowerPoint 2010 save (or open) VBA projects differently from 2007? Does anyone have technical information on that? Or has a suggestion where to search? (In case I am encountering the problem again.)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create microsoft Excel 2007 and 2010 File in .xlsx format ipacesetters Excel 1 12-16-2019 05:13 PM
Excel 2007 custom ribbon not showing in Excel 2010 Paulzak Excel 2 02-17-2012 06:35 PM
Incompatibility Excel VBA 2007/2010 VBA code from Excel 2007 in Excel 2010 csam63 Excel Programming 1 10-07-2011 10:46 AM
Excel 2010 Ribbon look like 2007's Ribbon esotop Excel 0 03-22-2011 07:05 PM
Incompatibility Excel VBA 2007/2010 Word Basic 2003 to Word Basic 2007 Incompatibility Mark1110 Word VBA 1 12-29-2010 11:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:41 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft