Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Automate differente excel versions + VBA protection

Göran,

I'm sorry but this type of switching between different versions of
Excel
on one platform is not supported. You may be able to accomplish this
to a degree, but you will only be able to run one instance of Excel at a
time.
If your workbooks are using Macro's, you can run into more diriculty. You
see
when VBA is initialized it looks in the registry. Whatever version of
Excel you
loaded last will be the key's it finds. This can and will cause type
library conflicts
as you will have different versions of the type libraries sent to Excel.


Stephen Culhane

Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.





--------------------
| Content-Class: urn:content-classes:message
| From: =?iso-8859-1?Q?G=F6ran_Rissler_=C5kesson?=
| Sender: =?iso-8859-1?Q?G=F6ran_Rissler_=C5kesson?=
| Subject: Automate differente excel versions + VBA protection
| Date: Mon, 7 Jul 2003 07:23:19 -0700
| Lines: 82
| Message-ID:
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: quoted-printable
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcNEk1BU0qmwyj0vR12EAOrEjiVJ9Q==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.excel.programming
| Path: cpmsftngxa09.phx.gbl
| Xref: cpmsftngxa09.phx.gbl microsoft.public.excel.programming:38256
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.excel.programming
|
| Hi,
| I'm trying to figure out a way to start and automate
| different versions of excel installed on one computer
| from VB. I know I can't use the CreateObject
| ("Excel.Application.x") where x would be the version,
| since all excels share the same identifier in the
| registry.
| I tried creating my own copies of the different excels
| registrations under other names like infolog.excel11 and
| infolog.excel10 and so on, but since my knowledge in COM
| is rather limited, I wasn't successfull. Excel hung on
| directly startup. Not even sure it would be possible.
| Is it possible to start the specified excel with, for
| example createprocess api, and then access the com
| interfaces of that process in some manner. Perhaps by
| using the processid somehow.
| I also have a problem with using the "Protect project
| from viewing" option in excel. I am developing a rather
| large and complex excel system which interact with a sql
| database. The system is based on several excel files,
| wich all have references to three central system files
| also excel files. They are used for manageing the entire
| system and any comunication with the database.
| If the references are there when I save the file. Opening
| of this file will be horribly slow on a computer where
| the path that was saved doesn't exist (unc network path).
| To get around this problem, I add these references
| dynamicly by using the AddFromFile command on the
| references collection in the VBProject on open. (i have
| allowed code access to the vbproject under security)
| This however creates another problem which i didn't find
| until recently. Since i'm effectivly modified the
| VBProject by doing this, if I add protection to the
| project i get into problems. As soon as the AddFromFile
| command is issued, a window pops up asking me for the
| password to view the project. This does seem correct. The
| weird thing however is that if I press the cancel button,
| the references are added as normal and the file starts up
| correctly. I even managed to use the SendKey command
| right before the AddFromFile to send an {ESC} keystroke,
| wich was picked up by the dialog. So I effectivly managed
| to get around the protection partly (the project is
| however still locked for viewing, so protection is still
| in place even if I did change it).
| This would have been perfect for me since I can keep my
| system the way it is and still use protection, exept for
| two problems with it.
| First: As excel loses focus when the dialog pops up and
| regains it after it creates a flashing effect. I add
| three references so it gets rather annoying.
| Two: I really don't know if this is how it is supposed to
| be (seems unlikely) so I might suddenly end up with a non
| working system if patch is released wich addresses the
| issue.
| My questions to u guys are, is this popup of the password
| dialog by design. It seems to me that there is no point
| in it popping up since if i press cencel everything works
| like it is supposed to and I manage to modify the project
| by adding references to it. And if it aint, is it
| something you might change in a update to the program?
| Also do you have any other ideas how to go about this,
| since i really like to be able to hide the code of the
| project. Rewriting my system files as an VB dll is not an
| option since I can't easily distribute the dll and
| register it on the systems.
| Hope you have some ideas or solutions.
| Thanx
| Göran Rissler Åkesson
| InfoLogistics MLC AB
| Sweden
|

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data table with inputs from a differente worksheet gu Excel Discussion (Misc queries) 1 April 19th 10 08:15 PM
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 02:20 AM
use a macro to automate excel worksheet password protection Bodyshopman Excel Discussion (Misc queries) 2 July 25th 07 01:21 AM
Please include fonts from previous versions ('98) in new versions JJBQ Excel Discussion (Misc queries) 3 October 8th 05 07:19 PM
Macro to automate page protection based on combo box reply wongard Excel Discussion (Misc queries) 9 September 9th 05 06:47 AM


All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"