Message 1 of 3
saveas syntax ??

Not applicable
11-18-2008
07:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello everyone,
I am trying to run a program that creates a folder then saves the current drawing into that folder.
It appears that I am having a problem with ThisDrawing.SaveAs syntax. I'm getting an "invalid file name" error. Could anyone help???
/code/
Option Explicit
' create a folder in ok laser
Const FolderPath = "R:\POSTIT\FIXTURES\FIX_ENG\MACHINE\OK_LASER\"
Private Sub CommandButton1_Click()
Dim strFolderPath As String
Dim foldername As String
Dim dwgName As String
foldername = Right(ThisDrawing.Path, Len(ThisDrawing.Path) - 67)
strFolderPath = FolderPath & "\" & foldername
dwgName = Left(ThisDrawing.Name, Len(ThisDrawing.Name) - 4)
If Dir(strFolderPath, vbDirectory) = "" Then
MkDir strFolderPath
End If
ThisDrawing.SaveAs strFolderPath & dwgName, acR15_dxf
ThisDrawing.Save
End Sub
/code/
I appreciate any advice.
End Sub
I am trying to run a program that creates a folder then saves the current drawing into that folder.
It appears that I am having a problem with ThisDrawing.SaveAs syntax. I'm getting an "invalid file name" error. Could anyone help???
/code/
Option Explicit
' create a folder in ok laser
Const FolderPath = "R:\POSTIT\FIXTURES\FIX_ENG\MACHINE\OK_LASER\"
Private Sub CommandButton1_Click()
Dim strFolderPath As String
Dim foldername As String
Dim dwgName As String
foldername = Right(ThisDrawing.Path, Len(ThisDrawing.Path) - 67)
strFolderPath = FolderPath & "\" & foldername
dwgName = Left(ThisDrawing.Name, Len(ThisDrawing.Name) - 4)
If Dir(strFolderPath, vbDirectory) = "" Then
MkDir strFolderPath
End If
ThisDrawing.SaveAs strFolderPath & dwgName, acR15_dxf
ThisDrawing.Save
End Sub
/code/
I appreciate any advice.
End Sub