deva_zg
11-08-2011, 04:02 AM
Hello!
I'm new to this forums and to VBA also.
I have a macro that copies some parts of the text to a Excell Workbook.
At the end it prompts me for a filedialog Save as to save it to a specific location.
Like this ...
Set fldlg = Application.FileDialog(msoFileDialogSaveAs)
fldlg.InitialFileName = strClientsPath & "P:\Projekti\FMS_INA\Projekt Siemens-EKUS\Ponude_Poslane\"
fldlg.Show
fldlg.Execute
Is there a way to name the file I'm saving as a text I copied from word to excel?
To be more specific, I'm using the code below ...
wd.Activate
Selection.HomeKey Unit:=wdLine
Selection.HomeKey Unit:=wdLine
Selection.HomeKey Unit:=wdStory
Selection.MoveDown Unit:=wdLine, Count:=10
Selection.MoveRight Unit:=wdWord, Count:=3
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Copy
Set exlapp = CreateObject("Excel.application.11")
Set exlwb = exlapp.Workbooks.Open("P:\Projekti\FMS_INA\Projekt EKUS\Ponude_Poslane\lista_ponuda.xls")
zred = exlwb.Worksheets(1).Cells(Rows.Count, 2).End(xlUp).Row
exlapp.Visible = True
With exlwb.Worksheets(1)
.Cells(zred + 1, 2).Select
.PasteSpecial Format:="Unicode Text", Link:=False, _
DisplayAsIcon:=False
End With
I'd like to name the file as the text that was copied to the excel ...
Thanks in advance
I'm new to this forums and to VBA also.
I have a macro that copies some parts of the text to a Excell Workbook.
At the end it prompts me for a filedialog Save as to save it to a specific location.
Like this ...
Set fldlg = Application.FileDialog(msoFileDialogSaveAs)
fldlg.InitialFileName = strClientsPath & "P:\Projekti\FMS_INA\Projekt Siemens-EKUS\Ponude_Poslane\"
fldlg.Show
fldlg.Execute
Is there a way to name the file I'm saving as a text I copied from word to excel?
To be more specific, I'm using the code below ...
wd.Activate
Selection.HomeKey Unit:=wdLine
Selection.HomeKey Unit:=wdLine
Selection.HomeKey Unit:=wdStory
Selection.MoveDown Unit:=wdLine, Count:=10
Selection.MoveRight Unit:=wdWord, Count:=3
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Copy
Set exlapp = CreateObject("Excel.application.11")
Set exlwb = exlapp.Workbooks.Open("P:\Projekti\FMS_INA\Projekt EKUS\Ponude_Poslane\lista_ponuda.xls")
zred = exlwb.Worksheets(1).Cells(Rows.Count, 2).End(xlUp).Row
exlapp.Visible = True
With exlwb.Worksheets(1)
.Cells(zred + 1, 2).Select
.PasteSpecial Format:="Unicode Text", Link:=False, _
DisplayAsIcon:=False
End With
I'd like to name the file as the text that was copied to the excel ...
Thanks in advance