Autosave

R

Rokuro kubi

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?
 
P

Peo Sjoblom

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

http://nwexcelsolutions.com
 
R

Rokuro kubi

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 :)
 
D

Dave Peterson

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 = "yourrealworkbookname.xla"

TestStr = ""
On Error Resume Next
TestStr = Dir(ThisWorkbook.Path & "\" & myRealWkbkName)
On Error GoTo 0

If TestStr = "" Then
MsgBox "Please contact Rokuro--he has problems!"
Else
resp = MsgBox(Prompt:="Do you want to install " _
& myRealWkbkName & "?", Buttons:=vbYesNo)

If resp = vbNo Then
'do nothing
Else
FileCopy Source:=ThisWorkbook.Path & "\" & myRealWkbkName, _
Destination:=Application.StartupPath & "\" & 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.
 
P

Peo Sjoblom

I almost posted a reply regarding whom you gave the files to, but you were
too fast this time <bg>

Peo
 
Top