R
Reha
Hello All,
I am running a macro from MS Word which extracts info from Word Tables
and put it in
Excel 2003.
The macro runs fine but I have a problem with saving the
ActiveWorkbook with the same path and name as the Word Document (sans
the extension .doc)
I have managed to make up following with my limited knowledge. I am
missing the <<<<<>>>>> part. Would appreciate any help please
Sub ToSaveFile()
Dim StrFile As String
Dim StrPath As String
Dim StrName As String
StrPath = ActiveDocument.Path 'Get document path
StrFile = ActiveDocument.Name 'Get document name
StrName = Left(StrFile, Len(StrFile) - 4) <<>>
sFilename = StrPath & StrName
<<<<<>>>>>>>>>
ActiveWorkbook.SaveAs sFileName
End Sub
The macro should save the Excel file (without any confirmation from
the user) with the same name as the Word Doc to the same path from
where the Doc file was opened.
Thanks in advance
Reha
I am running a macro from MS Word which extracts info from Word Tables
and put it in
Excel 2003.
The macro runs fine but I have a problem with saving the
ActiveWorkbook with the same path and name as the Word Document (sans
the extension .doc)
I have managed to make up following with my limited knowledge. I am
missing the <<<<<>>>>> part. Would appreciate any help please
Sub ToSaveFile()
Dim StrFile As String
Dim StrPath As String
Dim StrName As String
StrPath = ActiveDocument.Path 'Get document path
StrFile = ActiveDocument.Name 'Get document name
StrName = Left(StrFile, Len(StrFile) - 4) <<>>
sFilename = StrPath & StrName
<<<<<>>>>>>>>>
ActiveWorkbook.SaveAs sFileName
End Sub
The macro should save the Excel file (without any confirmation from
the user) with the same name as the Word Doc to the same path from
where the Doc file was opened.
Thanks in advance
Reha