HI!!
how can i copy all data from excel to word along with the cells?
Thanks and Regards
Vivek.s
Printable View
HI!!
how can i copy all data from excel to word along with the cells?
Thanks and Regards
Vivek.s
i just did a little test in excell and word, i saved a .xls file and oppened it in word, and it oppened succesfully!
so what do you mean?
PS: unless you plan on somehow making a poject relating to this subject please dont cross-thred
hi!
can u post that code.........?
thanks and regards
vivek.s
just save it in excel, and open it in word. no code required.
hi sorry........i wud like to copy data in sheet1 along with the cells(in a table) using my vb code.....
regards
vivek.s
my copy of word will open spreadsheets.
why dont you just use:
Shell("C:\Program Files\Microsoft Office\Office\WINWORD.EXE book1.xls")
hi!
i opened excel from word but i get following output
while my desired output isCode:†††††††††††††††††††††††††††††††††††††††††††††††††††B
†††††††††††††††††††††††††††††††††††††††††††††††††††䈠Ȁ
1㐱㔹㠠†††††††††††††††††††††††††††††††††††††††††††††††††††䈀Ȁ
Arial1
Arial1
Arial1
Arial1
"$"#,##0_);\("$"#,##0\)
"$"#,##0_);[Red]\("$"#,##0\)
"$"#,##0.00_);\("$"#,##0.00\)
"$"#,##0.00_);[Red]\("$"#,##0.00\)
_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)
_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)
_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)
_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)à
Sheet1
Sheet2
Sheet3
RECIEPT NUMBER
EMAIL ID
PASSPORT NUMBER
APPOINTMENT DATE ( mm-dd-yyyy)
RECIEPT NUMBER
EMAIL ID
PASSPORT NUMBER
APPOINTMENT DATE ( mm-dd-yyyy)
in a table..........
regards
vivek.s
anyways to do this?
thanks and regards
vivek.s
post it, and we'll take a look. you may have to copy/paste it into word.
hi:)
i have to do it using my VB program and data in excel shud be pated in a table in word.......
regards
vivek.s
just open excel, copy the cells, open word and paste them.
Sup vivek. You can insert an Excel workbook into a Word document like
below. Change the parameters if you want a linked object, etc.
Not sure if this is how you need it but I thought I would post it and find out.VB Code:
'Word application Application.Selection.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.8", FileName:= _ "D:\Book1.xls", LinkToFile:=False, DisplayAsIcon:=False
HTH
I started working on it once i realized noone else wants to takle this, (:eek:!!!NO OFFENCE!!!) and i got it to work sucessfully!!! just make a XLS called "Book1.xls" in drive C or just edit the code, and in the XLS put some data where ever, and then run this and it will make a file called "2.doc" on the C:\ and then open it and !Vwala!
PS: FYI, it is really slow!VB Code:
Dim objExcel As Object Dim objWord As Object Set objExcel = CreateObject("excel.application") Set objWord = CreateObject("word.application") objWord.documents.Add objExcel.workbooks.open ("C:\book1.xls") objExcel.cells.Select objExcel.cells.Copy objWord.selection.Paste objWord.activedocument.saveas "C:\2.doc" Clipboard.Clear objExcel.quit objWord.quit Set objWord = Nothing Set objExcel = Nothing
didn't you see RD's code? did you try it? (I didn't)
SUP GURU:)
WOW!!
THANKS A LOT GUYS!I'M GONNA TRY THESE OUT:)
:thumb:
Thanks and Regards
Vivek.s
I tried the code.........its working well for the first sheet.........but how can i copy the contents from second sheet or 3rd sheet?
Regards
karthik
Which posted code are you refering to?Quote:
Originally Posted by Karslive
i used the code given by All.......and modified to work for different sheets...i used this code
Set bk = objExcel.Workbooks.Open("C:\Book1.xls")
Set sh = bk.Worksheets("Sheet3")
sh.UsedRange.Copy
Now i am facing a problem.......on how to insert a string into word using VB.......
regards
karthi
If your using Alls code then the next line would be this - objWord.selection.Paste,
but you need his code to create the Word doc first.
HTH
i was going to add a thing so you could select what sheet to get data out of, but i figured i would keep it simple, it seems to work better usually :thumb: