Re: SaveAS PDF Differences




Mr. Who wrote:
Just before the save add something like this (make sure you add
reference to microsoft scripting runtime)

Dim fso As object
Dim file as object
set fso = createobject("Scripting.FileSytemObject")

if FileExists(PathToWhereFileWillBeSaved) = True Then
msgbox "I'm going to overwrite this file."
Set File = PathToWhereFileWillBeSaved
File.Delete
if FileExists(PathToWhereFileWillBeSaved) = True Then msgbox
"oops i couldnt delete the file. It must be open already or
something."
End if

Mr Who,

I cant get the above to work with my macro posted above. (I added a
reference to MS scripting runtime)

.



Relevant Pages

  • Re: File exists
    ... Private Sub Command1_Click ... Dim fso ... Set fso = CreateObject ... MsgBox "Yes, Sure!" ...
    (microsoft.public.vb.general.discussion)
  • Re: SaveAS PDF Differences
    ... reference to microsoft scripting runtime) ... Dim fso As object ... set fso = createobject ... msgbox "I'm going to overwrite this file." ...
    (comp.cad.solidworks)
  • Re: Disable the prompt when clicking on a protected cell?
    ... Dim FSO As Object ... Dim outgoingFilePath As String ... Set FSO = CreateObject ... MsgBox "Doesn't exist" ...
    (microsoft.public.excel.programming)
  • Re: Move, Rename,Delete File Script
    ... Set fso = CreateObject ... Msgbox "Completed." ... > I need to move a log file to a different folder and rename ...
    (microsoft.public.windows.server.scripting)
  • RE: Get file reference using File System Object
    ... Dim FSO As Scripting.FileSystemObject ... Dim FileItem As Scripting.File ... Set FSO = New Scripting.FileSystemObject ... MsgBox ...
    (microsoft.public.excel.programming)