Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Last saved by

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arne Hegefors - 07 Dec 2007 07:50 GMT
Hi! I have a macro that shows in a messagebox who used the most recent user
of a file is. It runs when the workbook is opened. Now I want to show who and
when saved the file the last time. How do I do that? Thanks!

Sub Auto_Open()
   Dim lngRäknare As Long, strSenastÖppnad As String
   Dim strMeddelande As String, strSenastAnvänd As String, strSenastSparad
As String

   'Hämtar data från Registry
   lngRäknare = GetSetting("Filinformation", "Fildata", "Antal", 0)
   strSenastÖppnad = GetSetting("Filinformation", "Fildata", "Öppnad", "")
   strSenastAnvänd = GetSetting("Filinformation", "Fildata", "Använd", "")
   strSenastSparad = GetSetting("Filinformation", "Fildata", "Sparad", "")
   'Visa information i messagebox
   strMeddelande = "Den här filen är öppnad " & lngRäknare & " gånger."
   strMeddelande = strMeddelande & vbNewLine & "Filen var senast öppnad: " _
   & strSenastÖppnad
   strMeddelande = strMeddelande & vbNewLine & "Filen användes senast av " _
   & strSenastAnvänd
   
   MsgBox "test" & strSenastSparad

   MsgBox strMeddelande, vbInformation, ThisWorkbook.Name

   'Uppdatera informationen och lagra den nya
   lngRäknare = lngRäknare + 1
   strSenastÖppnad = Date & " " & Time
   strSenastAnvänd = Application.UserName

   SaveSetting "Filinformation", "Fildata", "Antal", lngRäknare
   SaveSetting "Filinformation", "Fildata", "Öppnad", strSenastÖppnad
   SaveSetting "Filinformation", "Fildata", "Använd", strSenastAnvänd

End Sub
Mike H - 07 Dec 2007 08:37 GMT
Hi Arne,

I'm struggling with some of your variable names so in English try this:-

Sub stance()
MsgBox ThisWorkbook.BuiltinDocumentProperties("Last author").Value
End Sub

Mike

> Hi! I have a macro that shows in a messagebox who used the most recent user
> of a file is. It runs when the workbook is opened. Now I want to show who and
[quoted text clipped - 31 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.