Is there a way to get an excel macro/spreadsheet to automatically save
itself into the XLstart folder of a user who opens it in an email? Or
even just to show their C:/XLstart as the default save location when
they open the file?Not if they don't enable macros, besides it's not a good thing to do.
What if the person doesn't want to do this or someone else uses the same
design to spread virus..--
Regards,
Peo Sjoblom
nwexcelsolutions.comquot;Rokuro kubiquot; gt; wrote in message oups.com...
gt; Is there a way to get an excel macro/spreadsheet to automatically save
gt; itself into the XLstart folder of a user who opens it in an email? Or
gt; even just to show their C:/XLstart as the default save location when
gt; they open the file?
gt;
Yes I suppose this is why you need to be careful which attachments you
open. Just in my organisation quite a few people will switch off when I
tell them where to save it, if the path is any longer than longer than
one folder :-)I do something like this when I distribute a bunch of utilities to people--but
it's an addin.
I give email two files and tell them to file both attachments to any old
folder. (Or put both the files in a common network drive and have them run the
install workbook.)
This is the macro in the install workbook:
Option Explicit
Sub Auto_Open()
Dim resp As Long
Dim myRealWkbkName As String
Dim TestStr As String
myRealWkbkName = quot;yourrealworkbookname.xlaquot;
TestStr = quot;quot;
On Error Resume Next
TestStr = Dir(ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName)
On Error GoTo 0
If TestStr = quot;quot; Then
MsgBox quot;Please contact Rokuro--he has problems!quot;
Else
resp = MsgBox(Prompt:=quot;Do you want to install quot; _
amp; myRealWkbkName amp; quot;?quot;, Buttons:=vbYesNo)
If resp = vbNo Then
'do nothing
Else
FileCopy Source:=ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName, _
Destination:=Application.StartupPath amp; quot;\quot; amp; myRealWkbkName
End If
End If
'uncomment this after you've saved and tested the code.
'ThisWorkbook.Close savechanges:=False
End Sub
=========
Another option that you may want to consider. Put the addin (is it an addin???)
in a nice common network drive and tell the users to use tools|addins and browse
to that location to install the addin.
Rokuro kubi wrote:
gt;
gt; Yes I suppose this is why you need to be careful which attachments you
gt; open. Just in my organisation quite a few people will switch off when I
gt; tell them where to save it, if the path is any longer than longer than
gt; one folder :-)
--
Dave Peterson
Grammar police alert...
I give email two files...
I email two files...
Dave Peterson wrote:
gt;
gt; I do something like this when I distribute a bunch of utilities to people--but
gt; it's an addin.
gt;
gt; I give email two files and tell them to file both attachments to any old
gt; folder. (Or put both the files in a common network drive and have them run the
gt; install workbook.)
gt;
gt; This is the macro in the install workbook:
gt;
gt; Option Explicit
gt; Sub Auto_Open()
gt;
gt; Dim resp As Long
gt; Dim myRealWkbkName As String
gt; Dim TestStr As String
gt;
gt; myRealWkbkName = quot;yourrealworkbookname.xlaquot;
gt;
gt; TestStr = quot;quot;
gt; On Error Resume Next
gt; TestStr = Dir(ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName)
gt; On Error GoTo 0
gt;
gt; If TestStr = quot;quot; Then
gt; MsgBox quot;Please contact Rokuro--he has problems!quot;
gt; Else
gt; resp = MsgBox(Prompt:=quot;Do you want to install quot; _
gt; amp; myRealWkbkName amp; quot;?quot;, Buttons:=vbYesNo)
gt;
gt; If resp = vbNo Then
gt; 'do nothing
gt; Else
gt; FileCopy Source:=ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName, _
gt; Destination:=Application.StartupPath amp; quot;\quot; amp; myRealWkbkName
gt;
gt; End If
gt; End If
gt;
gt; 'uncomment this after you've saved and tested the code.
gt; 'ThisWorkbook.Close savechanges:=False
gt;
gt; End Sub
gt;
gt; =========
gt; Another option that you may want to consider. Put the addin (is it an addin???)
gt; in a nice common network drive and tell the users to use tools|addins and browse
gt; to that location to install the addin.
gt;
gt; Rokuro kubi wrote:
gt; gt;
gt; gt; Yes I suppose this is why you need to be careful which attachments you
gt; gt; open. Just in my organisation quite a few people will switch off when I
gt; gt; tell them where to save it, if the path is any longer than longer than
gt; gt; one folder :-)
gt;
gt; --
gt;
gt; Dave Peterson
--
Dave Peterson
I almost posted a reply regarding whom you gave the files to, but you were
too fast this time lt;bggt;
Peo
quot;Dave Petersonquot; gt; wrote in message
...
gt; Grammar police alert...
gt;
gt; I give email two files...
gt; I email two files...
gt;
gt;
gt;
gt; Dave Peterson wrote:
gt;gt;
gt;gt; I do something like this when I distribute a bunch of utilities to
gt;gt; people--but
gt;gt; it's an addin.
gt;gt;
gt;gt; I give email two files and tell them to file both attachments to any old
gt;gt; folder. (Or put both the files in a common network drive and have them
gt;gt; run the
gt;gt; install workbook.)
gt;gt;
gt;gt; This is the macro in the install workbook:
gt;gt;
gt;gt; Option Explicit
gt;gt; Sub Auto_Open()
gt;gt;
gt;gt; Dim resp As Long
gt;gt; Dim myRealWkbkName As String
gt;gt; Dim TestStr As String
gt;gt;
gt;gt; myRealWkbkName = quot;yourrealworkbookname.xlaquot;
gt;gt;
gt;gt; TestStr = quot;quot;
gt;gt; On Error Resume Next
gt;gt; TestStr = Dir(ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName)
gt;gt; On Error GoTo 0
gt;gt;
gt;gt; If TestStr = quot;quot; Then
gt;gt; MsgBox quot;Please contact Rokuro--he has problems!quot;
gt;gt; Else
gt;gt; resp = MsgBox(Prompt:=quot;Do you want to install quot; _
gt;gt; amp; myRealWkbkName amp; quot;?quot;,
gt;gt; Buttons:=vbYesNo)
gt;gt;
gt;gt; If resp = vbNo Then
gt;gt; 'do nothing
gt;gt; Else
gt;gt; FileCopy Source:=ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName, _
gt;gt; Destination:=Application.StartupPath amp; quot;\quot; amp;
gt;gt; myRealWkbkName
gt;gt;
gt;gt; End If
gt;gt; End If
gt;gt;
gt;gt; 'uncomment this after you've saved and tested the code.
gt;gt; 'ThisWorkbook.Close savechanges:=False
gt;gt;
gt;gt; End Sub
gt;gt;
gt;gt; =========
gt;gt; Another option that you may want to consider. Put the addin (is it an
gt;gt; addin???)
gt;gt; in a nice common network drive and tell the users to use tools|addins and
gt;gt; browse
gt;gt; to that location to install the addin.
gt;gt;
gt;gt; Rokuro kubi wrote:
gt;gt; gt;
gt;gt; gt; Yes I suppose this is why you need to be careful which attachments you
gt;gt; gt; open. Just in my organisation quite a few people will switch off when I
gt;gt; gt; tell them where to save it, if the path is any longer than longer than
gt;gt; gt; one folder :-)
gt;gt;
gt;gt; --
gt;gt;
gt;gt; Dave Peterson
gt;
gt; --
gt;
gt; Dave Peterson
A common problem lt;vvbggt;.
Oh, oh.
Peo Sjoblom wrote:
gt;
gt; I almost posted a reply regarding whom you gave the files to, but you were
gt; too fast this time lt;bggt;
gt;
gt; Peo
gt;
gt; quot;Dave Petersonquot; gt; wrote in message
gt; ...
gt; gt; Grammar police alert...
gt; gt;
gt; gt; I give email two files...
gt; gt; I email two files...
gt; gt;
gt; gt;
gt; gt;
gt; gt; Dave Peterson wrote:
gt; gt;gt;
gt; gt;gt; I do something like this when I distribute a bunch of utilities to
gt; gt;gt; people--but
gt; gt;gt; it's an addin.
gt; gt;gt;
gt; gt;gt; I give email two files and tell them to file both attachments to any old
gt; gt;gt; folder. (Or put both the files in a common network drive and have them
gt; gt;gt; run the
gt; gt;gt; install workbook.)
gt; gt;gt;
gt; gt;gt; This is the macro in the install workbook:
gt; gt;gt;
gt; gt;gt; Option Explicit
gt; gt;gt; Sub Auto_Open()
gt; gt;gt;
gt; gt;gt; Dim resp As Long
gt; gt;gt; Dim myRealWkbkName As String
gt; gt;gt; Dim TestStr As String
gt; gt;gt;
gt; gt;gt; myRealWkbkName = quot;yourrealworkbookname.xlaquot;
gt; gt;gt;
gt; gt;gt; TestStr = quot;quot;
gt; gt;gt; On Error Resume Next
gt; gt;gt; TestStr = Dir(ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName)
gt; gt;gt; On Error GoTo 0
gt; gt;gt;
gt; gt;gt; If TestStr = quot;quot; Then
gt; gt;gt; MsgBox quot;Please contact Rokuro--he has problems!quot;
gt; gt;gt; Else
gt; gt;gt; resp = MsgBox(Prompt:=quot;Do you want to install quot; _
gt; gt;gt; amp; myRealWkbkName amp; quot;?quot;,
gt; gt;gt; Buttons:=vbYesNo)
gt; gt;gt;
gt; gt;gt; If resp = vbNo Then
gt; gt;gt; 'do nothing
gt; gt;gt; Else
gt; gt;gt; FileCopy Source:=ThisWorkbook.Path amp; quot;\quot; amp; myRealWkbkName, _
gt; gt;gt; Destination:=Application.StartupPath amp; quot;\quot; amp;
gt; gt;gt; myRealWkbkName
gt; gt;gt;
gt; gt;gt; End If
gt; gt;gt; End If
gt; gt;gt;
gt; gt;gt; 'uncomment this after you've saved and tested the code.
gt; gt;gt; 'ThisWorkbook.Close savechanges:=False
gt; gt;gt;
gt; gt;gt; End Sub
gt; gt;gt;
gt; gt;gt; =========
gt; gt;gt; Another option that you may want to consider. Put the addin (is it an
gt; gt;gt; addin???)
gt; gt;gt; in a nice common network drive and tell the users to use tools|addins and
gt; gt;gt; browse
gt; gt;gt; to that location to install the addin.
gt; gt;gt;
gt; gt;gt; Rokuro kubi wrote:
gt; gt;gt; gt;
gt; gt;gt; gt; Yes I suppose this is why you need to be careful which attachments you
gt; gt;gt; gt; open. Just in my organisation quite a few people will switch off when I
gt; gt;gt; gt; tell them where to save it, if the path is any longer than longer than
gt; gt;gt; gt; one folder :-)
gt; gt;gt;
gt; gt;gt; --
gt; gt;gt;
gt; gt;gt; Dave Peterson
gt; gt;
gt; gt; --
gt; gt;
gt; gt; Dave Peterson
--
Dave Peterson
Thanks Dave, appreciated
- Dec 18 Mon 2006 20:34
Autosave
close
全站熱搜
留言列表
發表留言