Project is unviewable

J

Jan Kucera

is shown when I tries to expand the project in the VBA. Please help what to
do with it, how to avoid it later and how to recover the code..

Thanks, Jan.
 
J

Jonathan West

Jan Kucera said:
is shown when I tries to expand the project in the VBA. Please help what
to do with it, how to avoid it later and how to recover the code..


If the project is only loaded as an add-in then the code is not viewable.
Unlaod the add-in, open the template in an editing window and then open the
project.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
J

Jan Kucera

This is in opened template. I open the template as a document, see the
Test.dot in the application title but the project seems to be locked. I have
not locked the project or at least I don't know how to do it...
Jan
 
J

Jezebel

Word renders a project unviewable under some circumstances, even when the
template is open. I've never understood the sequence of events; but
re-started Word and re-opening the template seems to be the only way to get
back to the code.
 
J

Jan Kucera

Hi Jezebel.
Unfortunately this does not help. I've tried it opening from File menu and
from the explorer and it is the same. No way to explicitly unlock the
project?
 
J

Jan Kucera

From the sound of it, the template file has been damaged.
I've had that happen on the "odd occasion". Hope you made a
back-up copy, at some point?

Cindy Meister

Hi Cindy, mmm yes I did.... at some point... :-/ this wasn't the first time
in last couple of days.. so am I doing something wrong?

Is the VBA project saved compiled or as source and can be extracted from the
file?
(macros are running normally)

Thanks,
Jan.
 
C

Cindy M -WordMVP-

Hi Jan,
mmm yes I did.... at some point... :-/ this wasn't the first time
in last couple of days.. so am I doing something wrong?

Is the VBA project saved compiled or as source and can be extracted from the
file? (macros are running normally)
As far as I know, the VBA can't be extracted from a project that can't be
opened in the VB Editored. Not even in a file saved as Word 2003 XML. The one
thing you can try (but I'm not optimistic) is Tools/Templates and
Addins/Organizer. The tab for copying macros will let you copy a module from
one project to another (under normal circumstances).

The only other possibility I know of to access code is through the VBE (Visual
Basic Extensibility). Unfortunately (or fortunately, from my POV), I don't have
a file I could test this on. The following line of code, for example, will
export the specified code module of the given project (in this case "Module 1"
in the Normal.dot template) to a BAS file (emulates File/Export in the VB
Editor):

NormalTemplate.VBProject.VBComponents(2).Export("C:\Normal_Module1.bas")

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
J

Jan Kucera

Hi Cindy, thank you for getting know about this...

Unfortunately, no macros are displayed in the organizer and the VB syntax
throws error that it cannot perform operation since the project is
protected.

Nevermind, I will wrote it again... (and maybe better :) )
..and reminiscence the days with classic VB projects.. ;-)

Thanks again,
Jan.
 
A

Antigone via OfficeKB.com

I often have come across the same issue as you. It typically happens to me if
I try to edit a .dot file that is loaded at startup in the word/startup
folder. When I close word and move this file to a different location... say
up a folder, and double-click on it in the windows explorer it will open the .
dot file as Document 1 and I can edit the macros within the template saving
the template from the Visual Basic Editor.

Regards
~Antigone
 
J

Jan Kucera

Hi Antigone.
My template is in My Documents folder all the time. Moreover, I was *never*
able to view/edit the macros in the document created from the template, for
the same reason.

Last idea... could an external debugger be attached to the Word to step in
the VBA project?

Thanks for try,
Jan
 
C

Cindy M -WordMVP-

Hi Jan,
Nevermind, I will wrote it again... (and maybe better :) )
..and reminiscence the days with classic VB projects.. ;-)
The nice thing about those, of course, is that the code was
saved out in pure text format (*.bas). You can do that as a
backup in VBA, but you have to do it explicitly (I highly
recommend it): File/Export.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top