<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Beginsave/Endsave in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292988#M19189</link>
    <description>Sounds brilliant, Wouter&lt;BR /&gt;
&lt;BR /&gt;
I wish these support issues would now just GO AWAY so I can down to real work.  I'm e-mailing my work home this weekend, will possibly be able to report back on Monday.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again everyone for your help!  I'd be so lost without you.</description>
    <pubDate>Fri, 11 Jul 2008 12:47:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-07-11T12:47:20Z</dc:date>
    <item>
      <title>Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292969#M19170</link>
      <description>I think my brain is probably just in weekend mode already, this should be so easy but I just can't see it.&lt;BR /&gt;
&lt;BR /&gt;
What I want to do is to is to determine whether a drawing was successfully saved.  If it was not saved, it's name is removed from a list (Excel).  &lt;BR /&gt;
&lt;BR /&gt;
So I import the list from Excel into an array and sort it. And then I'm stuck.  Sure I can find out if the number of the drawing is in the list, but that doesn't help me. &lt;BR /&gt;
&lt;BR /&gt;
What parameter can I use to test whether the drawing has been saved or not? &lt;BR /&gt;
&lt;BR /&gt;
Also, I'm guessing I want to use the Endsave event, as I want to be sure it has been saved (or not).</description>
      <pubDate>Fri, 04 Jul 2008 07:01:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292969#M19170</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-04T07:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292970#M19171</link>
      <description>you might could check the drawing lastmodified propertywith tools ref microsoft scripting runtime</description>
      <pubDate>Sat, 05 Jul 2008 14:46:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292970#M19171</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-05T14:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292971#M19172</link>
      <description>Tertiacb&lt;BR /&gt;
&lt;BR /&gt;
From The AcadDocument_BeginSave Event module, you could write directly to a text file or write to your spread sheet. Is that an option?&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure exactly why you are doing this but you could write out the username  and time of save I'm sure&lt;BR /&gt;
&lt;BR /&gt;
ML</description>
      <pubDate>Sun, 06 Jul 2008 23:35:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292971#M19172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-06T23:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292972#M19173</link>
      <description>Yep,&lt;BR /&gt;
&lt;BR /&gt;
I just did a simple test; whenever I click save, this is returning the username&lt;BR /&gt;
&lt;BR /&gt;
So, let me know what you need to do; if you want to write to a .txt file, I can do that in not time for you.&lt;BR /&gt;
&lt;BR /&gt;
Private Sub AcadDocument_BeginSave(ByVal FileName As String)&lt;BR /&gt;
&lt;BR /&gt;
 Dim WshNetwork As Variant, Username As Variant&lt;BR /&gt;
 Set WshNetwork = CreateObject("WScript.Network")&lt;BR /&gt;
 Username = WshNetwork.Username&lt;BR /&gt;
 &lt;BR /&gt;
 MsgBox Username&lt;BR /&gt;
  &lt;BR /&gt;
End Sub</description>
      <pubDate>Sun, 06 Jul 2008 23:42:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292972#M19173</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-06T23:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292973#M19174</link>
      <description>Thanks for the replies!&lt;BR /&gt;
&lt;BR /&gt;
OK, to get down to details.&lt;BR /&gt;
&lt;BR /&gt;
I give users a list of drawing numbers to select from when they start a drawing.  This list is generated from an Excel sheet.  The drawings already used must not appear in the picklist. (And I can't delete them from the original spreadsheet.) In order to do this, I write the selected drawing number to a different spreadsheet.  When the user opens AutoCAD to select a new drawing, my program compares the original drawings numbers spreadsheet with the used numbers spreadsheet and filters out the already used numbers so as not to display them again.&lt;BR /&gt;
&lt;BR /&gt;
But now the problem is, what if the user doesn't save the drawing?  Then I have to roll back and remove the picked number from the used numbers spreadsheet, so that it will be displayed again the next time a new drawing is started.&lt;BR /&gt;
&lt;BR /&gt;
OK so there are several solutions.  &lt;BR /&gt;
&lt;BR /&gt;
I could search for the drawing number in the folders where drawings are stored.  This is likely to be pretty time-consuming as drawings can get saved in any one of several folders.  &lt;BR /&gt;
&lt;BR /&gt;
What I am trying to do is to remove the drawing number from the used numbers spreadsheet if the drawing is saved, but I don't know how to establish whether the drawing had actually been saved or not.  &lt;BR /&gt;
&lt;BR /&gt;
The same problem applies should I get the program to only add the used number to the used numbers spreadsheet upon saving of the drawing, I still need to know whether the user saved the drawing. Besides, then the user may be busy on the drawing for a whole day before the drawing number is removed from the picklist, and we are talking 20+ drafties using the same project...&lt;BR /&gt;
&lt;BR /&gt;
Oh, by the way, I appreciate the Username script - I have a field called "Drawn By" which I want to use to save the draftie's name, and using a computer-generated name is always more accurate than a typed name...&lt;BR /&gt;
&lt;BR /&gt;
Thanx!&lt;BR /&gt;
Tertia</description>
      <pubDate>Mon, 07 Jul 2008 05:31:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292973#M19174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-07T05:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292974#M19175</link>
      <description>Hey Tertia&lt;BR /&gt;
YW. &lt;BR /&gt;
&lt;BR /&gt;
Ok, that explains it a little better for sure.&lt;BR /&gt;
&lt;BR /&gt;
So, if a user saves a drawing, is that absolute evidence that the project number is in use? &lt;BR /&gt;
&lt;BR /&gt;
Are you using the acad.dvb file that holds all of the ACAD App level and Drawing Level events?&lt;BR /&gt;
&lt;BR /&gt;
If you decide that the Begin or End Save Event is the way to go then we  could have ACAD do the excel part for you or to really simply it; I think the easiest way to take it is to (using the acad.dvb file) simply write code in that event to one file on the serve.&lt;BR /&gt;
&lt;BR /&gt;
With The FSO (FileSystemObject) in VBScripting, we can write one line at a time to log each username, saved file name and time of save.&lt;BR /&gt;
&lt;BR /&gt;
In this scenario, we would just be keeping a log of save events throughout the day.&lt;BR /&gt;
&lt;BR /&gt;
However, if the user saves 35 times a day, do you really want it written 35 times? &lt;BR /&gt;
&lt;BR /&gt;
So, then, in that case, may be we could assign the first save event to a variable, write it out, then if the time of the each save thereafter = the time of the very first save, exit sub or something like that.&lt;BR /&gt;
&lt;BR /&gt;
So, the first thing I guess is to see if you are using the acad.dvb which automatically loads with ACAD?&lt;BR /&gt;
If so, is it the save event that you are definitely looking for?&lt;BR /&gt;
If so, do you think just writing to a text file will suffice?&lt;BR /&gt;
&lt;BR /&gt;
In Excel, you can even automate the process of importing the text file as external data and how it appears after import.&lt;BR /&gt;
&lt;BR /&gt;
May be that is a good idea; log the save (once a day) of each drawing, then at the end of the day, week, whatever, have a macro in your spread sheet that will bring in the text file.&lt;BR /&gt;
&lt;BR /&gt;
From there, you can use Vlookup or something like that to compare the results in Excel.&lt;BR /&gt;
&lt;BR /&gt;
Ok, well, I hope this helps&lt;BR /&gt;
&lt;BR /&gt;
I will wait to see what you decide, hopefully I can be of assistance.&lt;BR /&gt;
&lt;BR /&gt;
ML</description>
      <pubDate>Mon, 07 Jul 2008 07:10:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292974#M19175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-07T07:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292975#M19176</link>
      <description>Hey ML&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your input so far.  This sounds promising.&lt;BR /&gt;
&lt;BR /&gt;
I guess there is more than one object to the exercise.  Yes, evidence of the drawing/project number being in use is one of them. Providing a picklist of drawing numbers not in use, for a user creating a new drawing, is another.  The latter is what the focus is on right now.&lt;BR /&gt;
&lt;BR /&gt;
Yes, the .dvb loads with AutoCAD.  Actually I have split it into two .dvb's, the first dealing with providing the picklist and setting up the workspace for starting a new drawing, the other to do whatever has to be done when the user exits the drawing. And these live on the server and are referenced by the AutoCAD users.&lt;BR /&gt;
&lt;BR /&gt;
Unless I do something like searching folders for existing drawings to make sure they were actually saved, which I don't want to do due to the time consumption, I guess the Save event is the only other alternative?&lt;BR /&gt;
&lt;BR /&gt;
A text file may suffice, but as I have to write to-and-fro to Excel files anyway, I had made the decision to do all the datawriting and - storing in Excel on this particular project.  Such as, the storage column I want to use to write the Username to, is in the same spreadsheet where I extract the drawing number from.  Another consideration, of course, being that I am foreseeing people demanding lists of used drawings etc. in the future, and then it is all neatly stored in Excel already.&lt;BR /&gt;
&lt;BR /&gt;
Logging the daily save events would probably help, but I am concerned about a scenario like, user A creates a new drawing, accidentally picking the wrong number from the list of drawing numbers.  He exits the drawing without saving and creates a new drawing with the correct drawing number selected from the list.  User B wants to use the number user A had just discarded, but now the number is unavailable because of having been used by user A. I think making the drawing number available immediately if the drawing is not stored, is necessary. But then, if the FSO writes to a log, that could trigger some event, right?  &lt;BR /&gt;
&lt;BR /&gt;
I have never actually worked with FSO - I know vaguely about it, and saw some script using it, without paying much attention.&lt;BR /&gt;
&lt;BR /&gt;
You're right, I hardly want all the save events on one drawing number recorded.  I only need the first Save recorded.  The time and date are not considered of interest right now, although I think knowing when the drawing was started, may be useful.  But for that purpose just saving Currdate in a cell on the spreadsheet should suffice.&lt;BR /&gt;
&lt;BR /&gt;
All of which deals with detail if the drawing was saved.  The problem is how to establish if the drawing wasn't saved. so its number can be removed from the list of used drawing numbers.  Do you think one can get a reasonable way of establishing that using the FSO?&lt;BR /&gt;
&lt;BR /&gt;
Thanx!&lt;BR /&gt;
T</description>
      <pubDate>Mon, 07 Jul 2008 10:31:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292975#M19176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-07T10:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292976#M19177</link>
      <description>i found this somewhere...&lt;BR /&gt;
&lt;BR /&gt;
Public Function GetFileInfo(FileName As String, Optional fReturn As String) As String&lt;BR /&gt;
On Error GoTo err_fInfo&lt;BR /&gt;
&lt;BR /&gt;
Dim myFSO, myFileObject&lt;BR /&gt;
&lt;BR /&gt;
Dim lngAttributes As Long 'Attribute Values, explanation below&lt;BR /&gt;
Dim datCreated As Date 'Date and time the file was created.&lt;BR /&gt;
Dim datLastAccessed As Date 'Date and time the file was last accessed.&lt;BR /&gt;
Dim datLastModified As Date 'Date and time the file was last modified.&lt;BR /&gt;
Dim strDrive As String 'Drive letter of the drive where the file resides.&lt;BR /&gt;
Dim strName As String 'Sets or returns the name of the file.&lt;BR /&gt;
Dim strPath As String 'The path of the file, including drive letter.&lt;BR /&gt;
Dim strSize As String 'The size, in bytes, of the file.&lt;BR /&gt;
&lt;BR /&gt;
'*)Component values of the Attribute property. Attribute Value Description Access&lt;BR /&gt;
'Normal 0 Normal file; no attributes are set&lt;BR /&gt;
'ReadOnly 1 Read-only file Read/write&lt;BR /&gt;
'Hidden 2 Hidden file Read/write&lt;BR /&gt;
'System 4 System file Read/write&lt;BR /&gt;
'Volume 8 Disk drive volume label Read-only&lt;BR /&gt;
'Directory 16 Folder or directory Read-only&lt;BR /&gt;
'Archive 32 File has changed since last backup Read/write&lt;BR /&gt;
'Alias 64 Link or shortcut Read-only&lt;BR /&gt;
'Compressed 128 Compressed file Read-only&lt;BR /&gt;
&lt;BR /&gt;
Set myFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;
Set myFileObject = myFSO.GetFile(FileName)&lt;BR /&gt;
&lt;BR /&gt;
If fReturn = "" Then&lt;BR /&gt;
With myFileObject&lt;BR /&gt;
lngAttributes = .Attributes&lt;BR /&gt;
datCreated = .DateCreated&lt;BR /&gt;
datLastAccessed = .dateLastAccessed&lt;BR /&gt;
datLastModified = .dateLastModified&lt;BR /&gt;
strDrive = .Drive&lt;BR /&gt;
strName = .Name&lt;BR /&gt;
strPath = .path&lt;BR /&gt;
strSize = .Size&lt;BR /&gt;
End With&lt;BR /&gt;
' return all file info as string&lt;BR /&gt;
GetFileInfo = "File Information for file:" &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Filename: " &amp;amp; strName &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Attributes: " &amp;amp; lngAttributes &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Date Created: " &amp;amp; datCreated &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Date last Accessed: " &amp;amp; datLastAccessed &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Date Last Modified: " &amp;amp; datLastModified &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Drive: " &amp;amp; strDrive &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Path: " &amp;amp; strPath &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
"Size: " &amp;amp; strSize &amp;amp; " Bytes"&lt;BR /&gt;
Else&lt;BR /&gt;
Dim vReturn As Variant&lt;BR /&gt;
Select Case fReturn&lt;BR /&gt;
Case "DateCreated"&lt;BR /&gt;
vReturn = myFileObject.DateCreated&lt;BR /&gt;
Case "DateLastMod"&lt;BR /&gt;
vReturn = myFileObject.dateLastModified&lt;BR /&gt;
Case "DateLastAccessed"&lt;BR /&gt;
vReturn = myFileObject.dateLastAccessed&lt;BR /&gt;
Case "Size"&lt;BR /&gt;
vReturn = myFileObject.Size &amp;amp; " Bytes"&lt;BR /&gt;
Case Else&lt;BR /&gt;
vReturn = myFileObject.Name&lt;BR /&gt;
End Select&lt;BR /&gt;
GetFileInfo = vReturn&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
Exit_err:&lt;BR /&gt;
Set myFileObject = Nothing&lt;BR /&gt;
Set myFSO = Nothing&lt;BR /&gt;
Exit Function&lt;BR /&gt;
err_fInfo:&lt;BR /&gt;
GetFileInfo = Err.Description&lt;BR /&gt;
Resume Exit_err&lt;BR /&gt;
&lt;BR /&gt;
End Function ' GetFileInfo</description>
      <pubDate>Mon, 07 Jul 2008 12:40:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292976#M19177</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-07T12:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292977#M19178</link>
      <description>Thanks!&lt;BR /&gt;
&lt;BR /&gt;
I'm going to try it as soon as I get out of this meeting I have attend, if it doesn't last too long, otherwise tomorrow.&lt;BR /&gt;
&lt;BR /&gt;
Why can't management fathom that I prefer to talk to my PC rather than people?  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
T</description>
      <pubDate>Mon, 07 Jul 2008 12:46:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292977#M19178</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-07T12:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292978#M19179</link>
      <description>Some points to consider.&lt;BR /&gt;
&lt;BR /&gt;
1. What if the use takes a file name from the list and open a drawing, works &lt;BR /&gt;
on it without saving for long time (believe me, some CADer rarely hit "Save" &lt;BR /&gt;
button until he is done with it (for a few hours). By your logic, the file &lt;BR /&gt;
name is still available for other users (until the first user who takes the &lt;BR /&gt;
filename saves the drawing). So, other user could take the same file name. &lt;BR /&gt;
When he saves the drawing, he finds out a drawing with the save name has &lt;BR /&gt;
just been saved by someone else. I am not sure how the file name list is &lt;BR /&gt;
provided to users, within Acad? or from a stand-alone app? or from Excel &lt;BR /&gt;
application? You should not wait until drawing is saved to mark a file name &lt;BR /&gt;
being taken. It should be when user select a file name from the list, the &lt;BR /&gt;
file name then is marked as "Taken", you can then have some code to &lt;BR /&gt;
immediately open the new drawing and save it as the file name. Of course you &lt;BR /&gt;
need to handle situation, such as if a drawing is cancelled, the file name &lt;BR /&gt;
could be return to available file name list for reuse... I would do it in &lt;BR /&gt;
Acad VBA this way:&lt;BR /&gt;
    a. User starts Acad;&lt;BR /&gt;
    b. Click a custom menu/toolbar button to open a VBA form, which present &lt;BR /&gt;
available drawing file name list in the project (or entinre file name list &lt;BR /&gt;
with who take which file name...);&lt;BR /&gt;
    c. Once user pick a file name and click "OK", a new drawing is saved to &lt;BR /&gt;
selected file name. Of couse you can do more here, such as open a specific &lt;BR /&gt;
template, do neccesary initialization...&lt;BR /&gt;
    d. Update the fiel naame list. That is, set the just selected file name &lt;BR /&gt;
as "taken" by fill the record's other fields, such as "Drawn By", "Taken &lt;BR /&gt;
Time"....&lt;BR /&gt;
    e. You can provide a "Release" button on the form, in case a drawing &lt;BR /&gt;
that takes a file name is cancelled and you want the file name is available &lt;BR /&gt;
again.&lt;BR /&gt;
&lt;BR /&gt;
2. Why 2-spread sheets? a simple file name table is just fine with a column, &lt;BR /&gt;
such as "Taken Time". That is, if blank, the file name is available, if time &lt;BR /&gt;
is set, it is taken. Of course you can have more columns, like "Drawn By", &lt;BR /&gt;
"Chcecked By"... However, after your pains-taking effort to make it finally &lt;BR /&gt;
works, closely to your expectation, you would, very likely, regret that you &lt;BR /&gt;
chose Excel sheet instead of a database solution. Believe me, something like &lt;BR /&gt;
this with a sort of document tracking functionalities without database will &lt;BR /&gt;
not go far, even for a small drafting operation.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tertiacb" wrote in message news:5974451@discussion.autodesk.com...&lt;BR /&gt;
Thanks for the replies!&lt;BR /&gt;
&lt;BR /&gt;
OK, to get down to details.&lt;BR /&gt;
&lt;BR /&gt;
I give users a list of drawing numbers to select from when they start a &lt;BR /&gt;
drawing.  This list is generated from an Excel sheet.  The drawings already &lt;BR /&gt;
used must not appear in the picklist. (And I can't delete them from the &lt;BR /&gt;
original spreadsheet.) In order to do this, I write the selected drawing &lt;BR /&gt;
number to a different spreadsheet.  When the user opens AutoCAD to select a &lt;BR /&gt;
new drawing, my program compares the original drawings numbers spreadsheet &lt;BR /&gt;
with the used numbers spreadsheet and filters out the already used numbers &lt;BR /&gt;
so as not to display them again.&lt;BR /&gt;
&lt;BR /&gt;
But now the problem is, what if the user doesn't save the drawing?  Then I &lt;BR /&gt;
have to roll back and remove the picked number from the used numbers &lt;BR /&gt;
spreadsheet, so that it will be displayed again the next time a new drawing &lt;BR /&gt;
is started.&lt;BR /&gt;
&lt;BR /&gt;
OK so there are several solutions.&lt;BR /&gt;
&lt;BR /&gt;
I could search for the drawing number in the folders where drawings are &lt;BR /&gt;
stored.  This is likely to be pretty time-consuming as drawings can get &lt;BR /&gt;
saved in any one of several folders.&lt;BR /&gt;
&lt;BR /&gt;
What I am trying to do is to remove the drawing number from the used numbers &lt;BR /&gt;
spreadsheet if the drawing is saved, but I don't know how to establish &lt;BR /&gt;
whether the drawing had actually been saved or not.&lt;BR /&gt;
&lt;BR /&gt;
The same problem applies should I get the program to only add the used &lt;BR /&gt;
number to the used numbers spreadsheet upon saving of the drawing, I still &lt;BR /&gt;
need to know whether the user saved the drawing. Besides, then the user may &lt;BR /&gt;
be busy on the drawing for a whole day before the drawing number is removed &lt;BR /&gt;
from the picklist, and we are talking 20+ drafties using the same project...&lt;BR /&gt;
&lt;BR /&gt;
Oh, by the way, I appreciate the Username script - I have a field called &lt;BR /&gt;
"Drawn By" which I want to use to save the draftie's name, and using a &lt;BR /&gt;
computer-generated name is always more accurate than a typed name...&lt;BR /&gt;
&lt;BR /&gt;
Thanx!&lt;BR /&gt;
Tertia</description>
      <pubDate>Mon, 07 Jul 2008 23:21:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292978#M19179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-07T23:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292979#M19180</link>
      <description>Hi Tertia,&lt;BR /&gt;
I'm sorry, been busy all day.&lt;BR /&gt;
&lt;BR /&gt;
I did see that someone posted an example of VBScripting using FSO and it looks good, however it had attributes and all. That is cool, you can do a lot with Scripting, &lt;BR /&gt;
Generally, VBScripting code is placed into a .txt file, then you do Saveas a .vbs file. &lt;BR /&gt;
At which point you can simply double click the file to execute it. I have done some cool script then open acad and do some things. The other cool thing about VBScritping code is that it can be used in VBA as well, as long as you set a reference to the object that you need in VBA.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
OK, well in the below example, the first Sub, I am simply writing out the layers to a text file, it will appear on your desktop.&lt;BR /&gt;
&lt;BR /&gt;
Then in the second example, the file will be read from and assigned to a variable which then will display your layers in a msgbox in VBA.&lt;BR /&gt;
&lt;BR /&gt;
Ok, that is cool, right? Well, how does that help you? &lt;BR /&gt;
We would do something similar, only we are writing out an event, such as Save&lt;BR /&gt;
&lt;BR /&gt;
Now, Tertia, the file I am referring to is not just a .dvb file, it is the acad.dvb file. Are you using that particular file? &lt;BR /&gt;
Here yiou go, i will attach mine, so that you can see it.&lt;BR /&gt;
Place it in your ACAD-Support directory, fire up ACAD and it will be automatically loaded.&lt;BR /&gt;
Then, in the .dvb file, click on Thisdrawing and you will see the events I have coded. If you have not used it, you will find it extremely helpful.&lt;BR /&gt;
You see, each drawing has document level events, but what are you going to do, write code in every drawing? Of course not. So, The ACAD.dvb file loads automatically on startup and is in The User's VBA environment all of the time, independent of any drawings. In there we can access drawing and app level events. So, it is very important that you use that file, if this is to work properly. You will find it in your support directory, but in mine, there is already examples that I can share with you.&lt;BR /&gt;
&lt;BR /&gt;
Ok, so after you look at that file, realizing that this can be loaded into each person's support directory, which will load each time they fire up ACAD, you now have all events accessible to each user, all of the time.&lt;BR /&gt;
&lt;BR /&gt;
Ok, so, once we have that ready, we can then grab the Begin or End Save Event.&lt;BR /&gt;
&lt;BR /&gt;
With the below code, run it from a Sub in VBA and you will see that we can send ACAD info out to a text file and read it back into ACAD.&lt;BR /&gt;
&lt;BR /&gt;
We can write directly to Excel and that might make the most sense. Let me ask you , have you written any VBA code in Excel? If you had the code, we can just put it into ACAD-VBA&lt;BR /&gt;
If not, then I am not sure what to do; I would have to see the spread sheet etc. etc. in order to know precisely what to do.&lt;BR /&gt;
&lt;BR /&gt;
Ok, well try loading the acad.dvb file, play with that a bit, then try the below code. &lt;BR /&gt;
&lt;BR /&gt;
There is also a Begin Open File and a New Drawing Event in The App events, if you'd prefer that direction.&lt;BR /&gt;
&lt;BR /&gt;
Let me know what you decide and we will see if we can go forward. &lt;BR /&gt;
&lt;BR /&gt;
Tertia, the file would not attachas a .dvb file, so I changed the extension to xls in order to pass it to you&lt;BR /&gt;
After you download it, change the extension back to dvb and you should be fine&lt;BR /&gt;
&lt;BR /&gt;
Have a good night&lt;BR /&gt;
ML&lt;BR /&gt;
&lt;BR /&gt;
Public FSO As Variant, Username As Variant&lt;BR /&gt;
Public Dwgname As String&lt;BR /&gt;
Sub WriteToText()&lt;BR /&gt;
&lt;BR /&gt;
'This will write the .txt file to your desktop&lt;BR /&gt;
Dim FSO As Variant&lt;BR /&gt;
Dim MyFile As Variant&lt;BR /&gt;
Dim Layr As AcadLayer&lt;BR /&gt;
&lt;BR /&gt;
Set FSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;
Set WshNetwork = CreateObject("WScript.Network")&lt;BR /&gt;
&lt;BR /&gt;
Username = WshNetwork.Username&lt;BR /&gt;
Dwgname = UCase(Left$(ThisDrawing.Name, Len(ThisDrawing.Name) - 4))&lt;BR /&gt;
'Dwgname = "Layers"&lt;BR /&gt;
&lt;BR /&gt;
Set MyFile = FSO.CreateTextFile("C:\Documents and Settings\" &amp;amp; Username &amp;amp; "\Desktop\" &amp;amp; Dwgname &amp;amp; ".txt", True)&lt;BR /&gt;
&lt;BR /&gt;
For Each Layr In ThisDrawing.Layers&lt;BR /&gt;
 MyFile.WriteLine Layr.Name&lt;BR /&gt;
Next Layr&lt;BR /&gt;
&lt;BR /&gt;
MyFile.Close&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Sub ReadTextFile()&lt;BR /&gt;
&lt;BR /&gt;
'This will read the .txt file from your desktop into ACAD&lt;BR /&gt;
&lt;BR /&gt;
Dim Stream As Variant&lt;BR /&gt;
Dim Textstr As String&lt;BR /&gt;
&lt;BR /&gt;
Set FSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;
Set WshNetwork = CreateObject("WScript.Network")&lt;BR /&gt;
&lt;BR /&gt;
Username = WshNetwork.Username&lt;BR /&gt;
Dwgname = UCase(Left$(ThisDrawing.Name, Len(ThisDrawing.Name) - 4))&lt;BR /&gt;
                                                                   &lt;BR /&gt;
Set Stream = FSO.OpenTextFile("C:\Documents and Settings\" &amp;amp; Username &amp;amp; "\Desktop\" &amp;amp; Dwgname &amp;amp; ".txt")&lt;BR /&gt;
'Set FSO = Nothing&lt;BR /&gt;
&lt;BR /&gt;
Textstr = ""&lt;BR /&gt;
&lt;BR /&gt;
'While there are lines to read, continue on to the end of the file.&lt;BR /&gt;
'If the file is empty, we will reach the end of the stream and the variable Textstr will be returned as null.&lt;BR /&gt;
Do While Not Stream.AtEndOfStream&lt;BR /&gt;
 Textstr = Textstr &amp;amp; Stream.ReadLine &amp;amp; vbCrLf 'or VbNewline&lt;BR /&gt;
Loop&lt;BR /&gt;
'Set Stream = Nothing&lt;BR /&gt;
&lt;BR /&gt;
If Textstr  "" Then&lt;BR /&gt;
 MsgBox Textstr&lt;BR /&gt;
Else&lt;BR /&gt;
 MsgBox "The file you selected is empty"&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
Stream.Close&lt;BR /&gt;
 &lt;BR /&gt;
End Sub</description>
      <pubDate>Tue, 08 Jul 2008 03:30:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292979#M19180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-08T03:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292980#M19181</link>
      <description>Tertia&lt;BR /&gt;
It might jus be the resolution on my monitor but it looks like the bottom part of the second Sub says &lt;BR /&gt;
&lt;BR /&gt;
If Textstr "" Then&lt;BR /&gt;
&lt;BR /&gt;
Please make sure it says &lt;BR /&gt;
If Textstr &amp;lt;&amp;gt; "" Then&lt;BR /&gt;
&lt;BR /&gt;
That means, if textstream (txt file) is not nothing, then assign it to the variable, otherwwise we'd exit the sub&lt;BR /&gt;
&lt;BR /&gt;
ML</description>
      <pubDate>Tue, 08 Jul 2008 03:42:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292980#M19181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-08T03:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292981#M19182</link>
      <description>CADger&lt;BR /&gt;
&lt;BR /&gt;
Have you tried the script that you posted? &lt;BR /&gt;
I have not yet but it looks interesting.&lt;BR /&gt;
&lt;BR /&gt;
One thing I have always wanted to be able to do was change the date created and modified attributes of a file.&lt;BR /&gt;
&lt;BR /&gt;
This way, no one can really tell when you updated a file.&lt;BR /&gt;
It adds one more layer of privacy.&lt;BR /&gt;
&lt;BR /&gt;
I think that script will do this&lt;BR /&gt;
&lt;BR /&gt;
ML</description>
      <pubDate>Tue, 08 Jul 2008 03:46:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292981#M19182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-08T03:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292982#M19183</link>
      <description>nope i didn't try the routine above.. for some reason i don't have a help file for fso, but i found this&lt;BR /&gt;
&lt;BR /&gt;
http://www.itechies.net/tutorials/asp/filesystem.html &lt;BR /&gt;
&lt;BR /&gt;
as you can see datelastmodifed is a read-only property</description>
      <pubDate>Tue, 08 Jul 2008 13:14:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292982#M19183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-08T13:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292983#M19184</link>
      <description>CAD&lt;BR /&gt;
I have a ton of help links on VBScripting, I use it all of the time&lt;BR /&gt;
Here: &lt;BR /&gt;
Chew on these a bit; &lt;BR /&gt;
These are  3 of the main objects used in VBScripting.&lt;BR /&gt;
FSO: &lt;BR /&gt;
http://msdn.microsoft.com/en-us/library/z9ty6h50.aspx&lt;BR /&gt;
Wscript:&lt;BR /&gt;
http://msdn.microsoft.com/en-us/library/2795740w(VS.85).aspx&lt;BR /&gt;
another biggy&lt;BR /&gt;
WshShell&lt;BR /&gt;
http://msdn.microsoft.com/en-us/library/ahcz2kh6&lt;BR /&gt;
(VS.85).aspx&lt;BR /&gt;
There are lots of examples as well.&lt;BR /&gt;
Just copy the code into a txt file, do a saveas .vbs file.&lt;BR /&gt;
Then you double click The vbs file and off the script goes.&lt;BR /&gt;
Great stuff. &lt;BR /&gt;
If you grasp this stuff, then you can start out simple with ACAD; that is, set a reference to The ACAD App and start manipulating ACAD from outside of ACAD&lt;BR /&gt;
Simple example:&lt;BR /&gt;
This will open ACAD&lt;BR /&gt;
&lt;BR /&gt;
Dim Acad&lt;BR /&gt;
Set Acad = CreateObject("Autocad.Application")&lt;BR /&gt;
Acad.Visible = True&lt;BR /&gt;
&lt;BR /&gt;
Also, a free and really great program is called&lt;BR /&gt;
vbedit&lt;BR /&gt;
www.vbsedit.com&lt;BR /&gt;
With that you can debug the code and connect to the objects and properties in the app, such as ACAD, just like you would in VBA&lt;BR /&gt;
&lt;BR /&gt;
Hope you like&lt;BR /&gt;
ML</description>
      <pubDate>Wed, 09 Jul 2008 02:37:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292983#M19184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-09T02:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292984#M19185</link>
      <description>CAD&lt;BR /&gt;
&lt;BR /&gt;
This is a nice little link, thanks, i will keep that&lt;BR /&gt;
Still, I do believe there must be a way to manipulate that date.&lt;BR /&gt;
&lt;BR /&gt;
By the way, i use VBScript code in VBA a lot as well.&lt;BR /&gt;
&lt;BR /&gt;
ML</description>
      <pubDate>Wed, 09 Jul 2008 02:41:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292984#M19185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-09T02:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292985#M19186</link>
      <description>Tertiaa&lt;BR /&gt;
Have you given up?&lt;BR /&gt;
&lt;BR /&gt;
ML</description>
      <pubDate>Thu, 10 Jul 2008 06:25:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292985#M19186</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-10T06:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292986#M19187</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for all the advice so far, sorry I'm taking so long about it.  Two of our support guys haven't been in the office since Tuesday, so guess who get to do the support.  I'm just not getting around to even touching my programming.  So far today looks quieter...  I just want to sort out an array I managed to mess up and confuse myself with, first, though.  Will get back to you soonest.</description>
      <pubDate>Thu, 10 Jul 2008 06:34:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292986#M19187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-10T06:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292987#M19188</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Can't you use the variable DBMOD&lt;BR /&gt;
I use it to check if a drawing needs to be saved.&lt;BR /&gt;
&lt;BR /&gt;
When a drawing was saved successfully then the variable&lt;BR /&gt;
DBMOD is reset to 0</description>
      <pubDate>Fri, 11 Jul 2008 12:31:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292987#M19188</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-11T12:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Beginsave/Endsave</title>
      <link>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292988#M19189</link>
      <description>Sounds brilliant, Wouter&lt;BR /&gt;
&lt;BR /&gt;
I wish these support issues would now just GO AWAY so I can down to real work.  I'm e-mailing my work home this weekend, will possibly be able to report back on Monday.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again everyone for your help!  I'd be so lost without you.</description>
      <pubDate>Fri, 11 Jul 2008 12:47:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/beginsave-endsave/m-p/2292988#M19189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-11T12:47:20Z</dc:date>
    </item>
  </channel>
</rss>

