View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Automatic installer or what for distributing a template?

Congrats!

dk_ wrote:

Dave,

Thanks for the lesson!

My CD installer is working just right. A totally satisfying experience
developing this project.

-Dennis

In article ,
Dave Peterson wrote:

Inside the VBE, hit ctrl-g to see that immediate window.

You can put commands that you want executed directly in that window.
The ? is a shortcut for Print in this command:

?Application.TemplatesPath

While you're debugging your code, you could have a bunch of msgboxes
to indicate where you are. But then you'll have to dismiss those
before continuing.

An alternative would be to put:

debug.print "successfully in function abc"

You could sprinkle these kinds of lines throughout your code and then examine
that debug window to see what when wrong, er, worked ok.

dk_ wrote:

Dave,

You are so right! Sorry! I just burned a CD, (also tried a Flash
Drive), and both worked perfectly. Thank you.

What is the Immediate Window? I did what you described below and got the
same result. Would you explain it a bit?

Thats one more time.

-Dennis

In article ,
Dave Peterson wrote:

It would be pretty unusual for the Templates path to point at a
CD drive--how would you ever ensure that the correct disk is in
that CD.

I went to the immediate window of the VBE and did this:

?Application.TemplatesPath and got this back
C:\Documents and Settings\David Peterson\Application
Data\Microsoft\Templates\

I can't imagine anyone fiddling with this setting to point at a
removable disk drive.


dk_ wrote:

Dave,

I think I tried a similar routine from a CD and I believe that the
"Application.TemplatesPath" statement requires that TemplatesPath is on
the same drive as the file with the installer routine in it.

I understand the readonly deal.

Thanks.

-Dennis

In article ,
Dave Peterson wrote:

If ThisWorkbook is also on the same CD, then it doesn't look like
anything would change. But unless you're running some sort of DLA(?)
with your CDRW, the file will be readonly--so you won't have to
delete it.



dk_ wrote:

Dave,

I guess after all, it is a good idea to delete, (Kill), the
installer files. Less confusion for the user. Ron's
original install codes do use the Kill statement.

...Or, how could I modify the code below, to install from a
CD, rather than from a folder on the where Excel resides?

Sub Install_test()

If Dir(ThisWorkbook.Path & Application.PathSeparator &
"testerfile.xlt") < "" Then

FileCopy ThisWorkbook.Path & Application.PathSeparator
&
"testerfile.xlt" As Application.TemplatesPath &
"testerfile.xlt"

End Sub

Thanks.

-Dennis

In article ,
Dave Peterson wrote:

You may want to look at Kill in VBA's help (well, if you
want to delete the original file).

dk_ wrote:

Ron,

Solution accomplished for installing and also for replacing
existing an
excel template...

I changed your code from "Name" to "FileCopy" and then
adjusted the destination location to copy to.

Ron, Thank you very much for your help, inspiration and
your time. This has been fun.

Thank you again.

-Dennis

In article
,
dk_ wrote:

Ron,

Looking extremely good!

Your code works as is.


Now, would you add ONE MORE feature to this code??? :)

I'd like the installer workbook to be able to replace
and 'existing' template with the same name, (as does
your original email-sheet installer).

This way the code can be used for updating to a 'latest
version' of the template.


--
Dennis Kessler
http://www.denniskessler.com/acupuncture


--

Dave Peterson