Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
Is there an installer program available, or recommendations on how to
get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ....For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
Hi DK
Look at the code in the workbook open event of the install file of one of the templates http://www.rondebruin.nl/mail/templates.htm Disable macro's when you open the file so you can look at the code -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Is there an installer program available, or recommendations on how to get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ...For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
Note that this example is for a Sheet template
-- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Is there an installer program available, or recommendations on how to get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ...For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
Ron,
Your installer code is a thing of beauty! But there is good news, and there is bad news, (for me).... Is there away that I can delete the install code after my template is installed. Or, did I do the wrong thing? ...see just below. The good news... I double clicked your templates with Excel97--(Windows 98se), Excel97--(Windows XP), and Excel 98--(Macintosh, OS 9.1). Your very slick file was installed in the proper Templates folder on all three machines. Very, very nice!!! I then copied and pasted your code into one of my templates, in the 'ThisWorkbook' object window. I changed your filename, referenced in the procedure, to my current filename and saved my file. When I double clicked my template file with your code installed into it, the file was indeed installed in the Template folder. ...Perfect so far!!! When I start a new workbook using the File--New menu in Excel, click on my template, a new workbook is created. I save the new workbook and close that new workbook. ...Perfect again, so far. Now the bad news, (for me, anyway)... When I go to open the newly saved .xls workbook, that workbook runs the installer procedure again, which is stored in it's 'ThisWorkbook' object window. ....My new .xls file is not usable, (it closes), and a template is once again stored in the templates folder. So it goes in a circle. Would you coach me what to do from here? I see according to the way that I read your code, that the original file that I installed from, is supposed to be deleted, (I think), but it's still there also. Thank you for showing me, that it can be done! I like the way that you did your user messages also. -Dennis ------------------------------- In article , "Ron de Bruin" wrote: Hi DK Look at the code in the workbook open event of the install file of one of the templates http://www.rondebruin.nl/mail/templates.htm Disable macro's when you open the file so you can look at the code -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Is there an installer program available, or recommendations on how to get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ...For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
Hi dk
I install a sheet template The template sheet is in workbook(xls) that you download The code in the workbook open event copy the sheet to a new workbook and save that as template in the template folder. Then it delete the install workbook Do you want to install a sheet template ???? -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Ron, Your installer code is a thing of beauty! But there is good news, and there is bad news, (for me).... Is there away that I can delete the install code after my template is installed. Or, did I do the wrong thing? ...see just below. The good news... I double clicked your templates with Excel97--(Windows 98se), Excel97--(Windows XP), and Excel 98--(Macintosh, OS 9.1). Your very slick file was installed in the proper Templates folder on all three machines. Very, very nice!!! I then copied and pasted your code into one of my templates, in the 'ThisWorkbook' object window. I changed your filename, referenced in the procedure, to my current filename and saved my file. When I double clicked my template file with your code installed into it, the file was indeed installed in the Template folder. ...Perfect so far!!! When I start a new workbook using the File--New menu in Excel, click on my template, a new workbook is created. I save the new workbook and close that new workbook. ...Perfect again, so far. Now the bad news, (for me, anyway)... When I go to open the newly saved .xls workbook, that workbook runs the installer procedure again, which is stored in it's 'ThisWorkbook' object window. ...My new .xls file is not usable, (it closes), and a template is once again stored in the templates folder. So it goes in a circle. Would you coach me what to do from here? I see according to the way that I read your code, that the original file that I installed from, is supposed to be deleted, (I think), but it's still there also. Thank you for showing me, that it can be done! I like the way that you did your user messages also. -Dennis ------------------------------- In article , "Ron de Bruin" wrote: Hi DK Look at the code in the workbook open event of the install file of one of the templates http://www.rondebruin.nl/mail/templates.htm Disable macro's when you open the file so you can look at the code -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Is there an installer program available, or recommendations on how to get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ...For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
In article ,
"Ron de Bruin" wrote: Hi dk I install a sheet template The template sheet is in workbook(xls) that you download The code in the workbook open event copy the sheet to a new workbook and save that as template in the template folder. Then it delete the install workbook Ron, Yes, I see how your template does what you wrote above. Nicely done. Do you want to install a sheet template ???? ***** No, I wish to be able to install a complete .xlt workbook, (not a sheet only). ******** I could not figure out how to change your sheet-template-installer routine, to make it a workbook-installer-routine. Would you coach me how to change your code for this? I have spent time trying to alter the code. I can imagine that using some bits of your code, that I could copy parts of the code into a seperate workbook that would install my main template and in that way I could get around the newly created file self-deleting itself. Thanks for your attention. -Dennis -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Ron, Your installer code is a thing of beauty! But there is good news, and there is bad news, (for me).... Is there away that I can delete the install code after my template is installed. Or, did I do the wrong thing? ...see just below. The good news... I double clicked your templates with Excel97--(Windows 98se), Excel97--(Windows XP), and Excel 98--(Macintosh, OS 9.1). Your very slick file was installed in the proper Templates folder on all three machines. Very, very nice!!! I then copied and pasted your code into one of my templates, in the 'ThisWorkbook' object window. I changed your filename, referenced in the procedure, to my current filename and saved my file. When I double clicked my template file with your code installed into it, the file was indeed installed in the Template folder. ...Perfect so far!!! When I start a new workbook using the File--New menu in Excel, click on my template, a new workbook is created. I save the new workbook and close that new workbook. ...Perfect again, so far. Now the bad news, (for me, anyway)... When I go to open the newly saved .xls workbook, that workbook runs the installer procedure again, which is stored in it's 'ThisWorkbook' object window. ...My new .xls file is not usable, (it closes), and a template is once again stored in the templates folder. So it goes in a circle. Would you coach me what to do from here? I see according to the way that I read your code, that the original file that I installed from, is supposed to be deleted, (I think), but it's still there also. Thank you for showing me, that it can be done! I like the way that you did your user messages also. -Dennis ------------------------------- In article , "Ron de Bruin" wrote: Hi DK Look at the code in the workbook open event of the install file of one of the templates http://www.rondebruin.nl/mail/templates.htm Disable macro's when you open the file so you can look at the code -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Is there an installer program available, or recommendations on how to get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ...For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis -- Dennis Kessler http://www.denniskessler.com/acupuncture |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
Hi DK
Not tested but try this Create a new workbook (named install.xls) and copy this code in the thisworkbook module Private Sub Workbook_Open() If Dir(ThisWorkbook.Path & "\your.xlt") < "" Then Name ThisWorkbook.Path & "\your.xlt" As Application.TemplatesPath & "\your.xlt" With ThisWorkbook .Saved = True .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With End If End Sub Now give the user this workbook and the template your.xlt and say to run the workbook to install the template Both files must be in the same folder. It move the xlt to the template folder and kill the install xls -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... In article , "Ron de Bruin" wrote: Hi dk I install a sheet template The template sheet is in workbook(xls) that you download The code in the workbook open event copy the sheet to a new workbook and save that as template in the template folder. Then it delete the install workbook Ron, Yes, I see how your template does what you wrote above. Nicely done. Do you want to install a sheet template ???? ***** No, I wish to be able to install a complete .xlt workbook, (not a sheet only). ******** I could not figure out how to change your sheet-template-installer routine, to make it a workbook-installer-routine. Would you coach me how to change your code for this? I have spent time trying to alter the code. I can imagine that using some bits of your code, that I could copy parts of the code into a seperate workbook that would install my main template and in that way I could get around the newly created file self-deleting itself. Thanks for your attention. -Dennis -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Ron, Your installer code is a thing of beauty! But there is good news, and there is bad news, (for me).... Is there away that I can delete the install code after my template is installed. Or, did I do the wrong thing? ...see just below. The good news... I double clicked your templates with Excel97--(Windows 98se), Excel97--(Windows XP), and Excel 98--(Macintosh, OS 9.1). Your very slick file was installed in the proper Templates folder on all three machines. Very, very nice!!! I then copied and pasted your code into one of my templates, in the 'ThisWorkbook' object window. I changed your filename, referenced in the procedure, to my current filename and saved my file. When I double clicked my template file with your code installed into it, the file was indeed installed in the Template folder. ...Perfect so far!!! When I start a new workbook using the File--New menu in Excel, click on my template, a new workbook is created. I save the new workbook and close that new workbook. ...Perfect again, so far. Now the bad news, (for me, anyway)... When I go to open the newly saved .xls workbook, that workbook runs the installer procedure again, which is stored in it's 'ThisWorkbook' object window. ...My new .xls file is not usable, (it closes), and a template is once again stored in the templates folder. So it goes in a circle. Would you coach me what to do from here? I see according to the way that I read your code, that the original file that I installed from, is supposed to be deleted, (I think), but it's still there also. Thank you for showing me, that it can be done! I like the way that you did your user messages also. -Dennis ------------------------------- In article , "Ron de Bruin" wrote: Hi DK Look at the code in the workbook open event of the install file of one of the templates http://www.rondebruin.nl/mail/templates.htm Disable macro's when you open the file so you can look at the code -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Is there an installer program available, or recommendations on how to get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ...For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis -- Dennis Kessler http://www.denniskessler.com/acupuncture |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
Ron,
Looking extremely good! Your code works as is. I then modified your code, adding "& Application.PathSeparator" in two places, (see just below), so that it would also work on a Macintosh, and it does, with one caveat, ... the installer workbook must be on the same hard drive as the Excel program. 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. Currently this installer workbook, (with the code below), will halt when opened if there is already a file in the Templates folder with the same name, and will display the following message: "Run-time error '58': File already exists. ' This code below was tested and works on: ' Excel97 Windows 98se, and XP, and on ' Excel98 Macintosh OS 9.1 Private Sub Workbook_Open() If Dir(ThisWorkbook.Path & Application.PathSeparator & "testerfile.xlt") < "" Then Name ThisWorkbook.Path & Application.PathSeparator & "testerfile.xlt" As Application.TemplatesPath & "testerfile.xlt" With ThisWorkbook .Saved = True .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With End If End Sub Thank you RON!!! I wonder why a utility like this is not part of Miscosoft's distribution. Cheers. -Dennis In article , "Ron de Bruin" wrote: Hi DK Not tested but try this Create a new workbook (named install.xls) and copy this code in the thisworkbook module Private Sub Workbook_Open() If Dir(ThisWorkbook.Path & "\your.xlt") < "" Then Name ThisWorkbook.Path & "\your.xlt" As Application.TemplatesPath & "\your.xlt" With ThisWorkbook .Saved = True .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With End If End Sub Now give the user this workbook and the template your.xlt and say to run the workbook to install the template Both files must be in the same folder. It move the xlt to the template folder and kill the install xls -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... In article , "Ron de Bruin" wrote: Hi dk I install a sheet template The template sheet is in workbook(xls) that you download The code in the workbook open event copy the sheet to a new workbook and save that as template in the template folder. Then it delete the install workbook Ron, Yes, I see how your template does what you wrote above. Nicely done. Do you want to install a sheet template ???? ***** No, I wish to be able to install a complete .xlt workbook, (not a sheet only). ******** I could not figure out how to change your sheet-template-installer routine, to make it a workbook-installer-routine. Would you coach me how to change your code for this? I have spent time trying to alter the code. I can imagine that using some bits of your code, that I could copy parts of the code into a seperate workbook that would install my main template and in that way I could get around the newly created file self-deleting itself. Thanks for your attention. -Dennis -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Ron, Your installer code is a thing of beauty! But there is good news, and there is bad news, (for me).... Is there away that I can delete the install code after my template is installed. Or, did I do the wrong thing? ...see just below. The good news... I double clicked your templates with Excel97--(Windows 98se), Excel97--(Windows XP), and Excel 98--(Macintosh, OS 9.1). Your very slick file was installed in the proper Templates folder on all three machines. Very, very nice!!! I then copied and pasted your code into one of my templates, in the 'ThisWorkbook' object window. I changed your filename, referenced in the procedure, to my current filename and saved my file. When I double clicked my template file with your code installed into it, the file was indeed installed in the Template folder. ...Perfect so far!!! When I start a new workbook using the File--New menu in Excel, click on my template, a new workbook is created. I save the new workbook and close that new workbook. ...Perfect again, so far. Now the bad news, (for me, anyway)... When I go to open the newly saved .xls workbook, that workbook runs the installer procedure again, which is stored in it's 'ThisWorkbook' object window. ...My new .xls file is not usable, (it closes), and a template is once again stored in the templates folder. So it goes in a circle. Would you coach me what to do from here? I see according to the way that I read your code, that the original file that I installed from, is supposed to be deleted, (I think), but it's still there also. Thank you for showing me, that it can be done! I like the way that you did your user messages also. -Dennis ------------------------------- In article , "Ron de Bruin" wrote: Hi DK Look at the code in the workbook open event of the install file of one of the templates http://www.rondebruin.nl/mail/templates.htm Disable macro's when you open the file so you can look at the code -- Regards Ron de Bruin http://www.rondebruin.nl "dk_" wrote in message ... Is there an installer program available, or recommendations on how to get people be able to put a template file in the appropriate Office Template folder, (for a small distribution of people)? ...For many people this seems to an impossible or a very intimidating task, simple as it should be. Thanks. -Dennis -- Dennis Kessler http://www.denniskessler.com/acupuncture -- Dennis Kessler http://www.denniskessler.com/acupuncture |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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. |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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. -- Dave Peterson |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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. |
#12
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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. -- Dave Peterson |
#13
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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. |
#14
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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. -- Dave Peterson |
#15
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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 |
#16
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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 |
#17
Posted to microsoft.public.excel.misc
|
|||
|
|||
Automatic installer or what for distributing a template?
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 |
#18
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Invoice Template | Excel Discussion (Misc queries) | |||
Automatic Template Help in task pane | Excel Discussion (Misc queries) | |||
Setup Purchase Order Template to have a automatic number system? | Excel Worksheet Functions | |||
Automatic filename generation template | Excel Discussion (Misc queries) | |||
Template in Excel | New Users to Excel |