ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code Editing Code (https://www.excelbanter.com/excel-programming/277934-re-code-editing-code.html)

Tom Ogilvy

Code Editing Code
 
the only way would be with sendkeys.

Hardly reliable.

--
Regards,
Tom Ogilvy

Walt Weber wrote in message
...
Hi,

Some time ago I wrote an application now used at many
worksites (All sites use Excel 2000 or 2002 on Windows
platforms from Win95 through Win XP, Win NT4.0, and Win
2000) scattered about the western US. It's now important
to distribute an update to those applications. In
looking through the item titled "Programming To The Visual
Basic Editor" on Chip Pearson's web site
(http://www.cpearson.com/excel/vbe.htm), I see the
following notations included:

"Before using these procedures, you'll need to set a
reference in VBA to the VBA Extensibility library. In the
VBA editor, go to the Tools menu, choose the References
item, and put a check next to "Microsoft Visual Basic For
Applications Extensibility" library. This enables VBA to
find the definitions of these objects. If you are using
Excel97, this library will appear in the References list
without a version number: "Microsoft Visual Basic For
Applications Extensibility". If you are using Excel 2000
or 2002, it will appear with a version number: "Microsoft
Visual Basic For Applications Extensibility 5.3". It is
very important that you reference the proper library. If
you reference the wrong library, you will receive "Type
Mismatch" errors. If you don't reference the
extensibility library at all, you will receive "User
Defined Type Not Defined Error"."

Setting the reference to Microsoft Visual Basic For
Applications Extensibility 5.3 in my update routine within
an 'update.xls' file should deal with this.

And

"Note: An additional level of security was added in Excel
2002. To manipulate the VBA Project objects as described
here, you'll have to change your security setting. Go to
the Tools menu, choose Macros, then Security. Click
the "Trusted Sources" tab, and put a check next to
the "Trust access to Visual Basic Project".

NOTE: In all versions of Excel, the VBProject must not be
protected. If it is, these procedures will fail. In
Excel 2002, you must have "Trust Access To Visual Basic
Project" enabled."

While I can instruct those with Excel 2002 to 'put a check
next to the "Trust access to Visual Basic Project"', the
code is password protected (I set the password). Is
there some way I can send the password to the VBE to open
and edit the code?

I can and have written routines to export all site
specific data and then import that data into a new
version, but this approach is cumbersome. Editing the
code would be much nicer.

Best Regards,
Walt





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com