Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to create word file

Hi,
I want to create one word file from excel file, eg
if in one cell mention txt is Mudit , in other 29.....

i want out in .doc format - My Name is Mudit, I am 29 year old.

I mean to say it take data from xls and create one doc file.

i want to use VBA.....

I am novice for this.

Please help me

Mudit

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default How to create word file

"Mudit" wrote in message
ps.com...
Hi,
I want to create one word file from excel file, eg
if in one cell mention txt is Mudit , in other 29.....

i want out in .doc format - My Name is Mudit, I am 29 year old.

I mean to say it take data from xls and create one doc file.

i want to use VBA.....

I am novice for this.

Please help me

Mudit



Save the file as txt and then open in Word.......


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to create word file


HI Mudit,

There are two ways u can achieve this, you can create an excel
macro...which opens a new word document and adds text in that excel
file in which macro is defined ... or you can create an application
which will ask path for the excel file from which data is to be
taken...and creates a new document.I m giving here a word macro. create
a new word document and go to VBE. paste the following code:

Sub AutoOpen()
'Enter File Path
x = InputBox("Enter the path of excel file" & Chr$(13) & Chr$(13) _
& "For example: C:\Customer.xls")'Enter file path
Call gen_doc(x)
End Sub
Function gen_doc(x)
Application.Documents.Add
ActiveDocument.ActiveWindow.View = wdPrintView
'Create an excel object
Set objExcel = CreateObject("Excel.Application")'first excel object
has
'to be created
'open that particular excel document
Set xlWB = objExcel.Workbooks.Open(x)

On Error Resume Next

'open first sheet
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Visible = True
sname = objExcel.Cells(1, 1).Value
ActiveDocument.Select
Selection.TypeText Text:=sname

objSheet.Close False
xlWB.Close False ' close the workbook without saving
objExcel.Quit ' close the Excel application
Set objSheet = Nothing
Set xlWB = Nothing
Set objExcel = Nothing

End Function

and explore other possibilities.
Hope it helps :)
Movi1982




Mudit Wrote:
Hi,
I want to create one word file from excel file, eg
if in one cell mention txt is Mudit , in other 29.....

i want out in .doc format - My Name is Mudit, I am 29 year old.

I mean to say it take data from xls and create one doc file.

i want to use VBA.....

I am novice for this.

Please help me

Mudit



--
movi1982
------------------------------------------------------------------------
movi1982's Profile: http://www.excelforum.com/member.php...o&userid=36423
View this thread: http://www.excelforum.com/showthread...hreadid=562350

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to create word file


HI Mudit,

There are two ways u can achieve this, you can create an excel
macro...which opens a new word document and adds text in that excel
file in which macro is defined ... or you can create an application
which will ask path for the excel file from which data is to be
taken...and creates a new document.I m giving here a word macro. create
a new word document and go to VBE. paste the following code:

Sub AutoOpen()
'Enter File Path
x = InputBox("Enter the path of excel file" & Chr$(13) & Chr$(13) _
& "For example: C:\Customer.xls")'Enter file path
Call gen_doc(x)
End Sub
Function gen_doc(x)
Application.Documents.Add
ActiveDocument.ActiveWindow.View = wdPrintView
'Create an excel object
Set objExcel = CreateObject("Excel.Application")'first excel object
has
'to be created
'open that particular excel document
Set xlWB = objExcel.Workbooks.Open(x)

On Error Resume Next

'open first sheet
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Visible = True
sname = objExcel.Cells(1, 1).Value
ActiveDocument.Select
Selection.TypeText Text:=sname

objSheet.Close False
xlWB.Close False ' close the workbook without saving
objExcel.Quit ' close the Excel application
Set objSheet = Nothing
Set xlWB = Nothing
Set objExcel = Nothing

End Function

and explore other possibilities.
Hope it helps :)
Movi1982




Mudit Wrote:
Hi,
I want to create one word file from excel file, eg
if in one cell mention txt is Mudit , in other 29.....

i want out in .doc format - My Name is Mudit, I am 29 year old.

I mean to say it take data from xls and create one doc file.

i want to use VBA.....

I am novice for this.

Please help me

Mudit



--
movi1982
------------------------------------------------------------------------
movi1982's Profile: http://www.excelforum.com/member.php...o&userid=36423
View this thread: http://www.excelforum.com/showthread...hreadid=562350

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to create word file


HI Mudit,

There are two ways u can achieve this, you can create an excel
macro...which opens a new word document and adds text in that excel
file in which macro is defined ... or you can create an application
which will ask path for the excel file from which data is to be
taken...and creates a new document.I m giving here a word macro. create
a new word document and go to VBE. paste the following code:

Sub AutoOpen()
'Enter File Path
x = InputBox("Enter the path of excel file" & Chr$(13) & Chr$(13) _
& "For example: C:\Customer.xls")'Enter file path
Call gen_doc(x)
End Sub
Function gen_doc(x)
Application.Documents.Add
ActiveDocument.ActiveWindow.View = wdPrintView
'Create an excel object
Set objExcel = CreateObject("Excel.Application")'first excel object
has
'to be created
'open that particular excel document
Set xlWB = objExcel.Workbooks.Open(x)

On Error Resume Next

'open first sheet
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Visible = True
sname = objExcel.Cells(1, 1).Value
ActiveDocument.Select
Selection.TypeText Text:=sname

objSheet.Close False
xlWB.Close False ' close the workbook without saving
objExcel.Quit ' close the Excel application
Set objSheet = Nothing
Set xlWB = Nothing
Set objExcel = Nothing

End Function

and explore other possibilities.
Hope it helps :)
Movi1982


Mudit Wrote:
Hi,
I want to create one word file from excel file, eg
if in one cell mention txt is Mudit , in other 29.....

i want out in .doc format - My Name is Mudit, I am 29 year old.

I mean to say it take data from xls and create one doc file.

i want to use VBA.....

I am novice for this.

Please help me

Mudit



--
movi1982
------------------------------------------------------------------------
movi1982's Profile: http://www.excelforum.com/member.php...o&userid=36423
View this thread: http://www.excelforum.com/showthread...hreadid=562350



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to create word file


HI Mudit,

There are two ways u can achieve this, you can create an excel
macro...which opens a new word document and adds text in that excel
file in which macro is defined ... or you can create an application
which will ask path for the excel file from which data is to be
taken...and creates a new document.I m giving here a word macro. create
a new word document and go to VBE. paste the following code:

Sub AutoOpen()
'Enter File Path
x = InputBox("Enter the path of excel file" & Chr$(13) & Chr$(13) _
& "For example: C:\Customer.xls")'Enter file path
Call gen_doc(x)
End Sub
Function gen_doc(x)
Application.Documents.Add
ActiveDocument.ActiveWindow.View = wdPrintView
'Create an excel object
Set objExcel = CreateObject("Excel.Application")'first excel object
has
'to be created
'open that particular excel document
Set xlWB = objExcel.Workbooks.Open(x)

On Error Resume Next

'open first sheet
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Visible = True
sname = objExcel.Cells(1, 1).Value
ActiveDocument.Select
Selection.TypeText Text:=sname

objSheet.Close False
xlWB.Close False ' close the workbook without saving
objExcel.Quit ' close the Excel application
Set objSheet = Nothing
Set xlWB = Nothing
Set objExcel = Nothing

End Function

and explore other possibilities.
Hope it helps :)
Movi1982


Mudit Wrote:
Hi,
I want to create one word file from excel file, eg
if in one cell mention txt is Mudit , in other 29.....

i want out in .doc format - My Name is Mudit, I am 29 year old.

I mean to say it take data from xls and create one doc file.

i want to use VBA.....

I am novice for this.

Please help me

Mudit



--
movi1982
------------------------------------------------------------------------
movi1982's Profile: http://www.excelforum.com/member.php...o&userid=36423
View this thread: http://www.excelforum.com/showthread...hreadid=562350

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a new Excel file with selected cells john Excel Discussion (Misc queries) 2 July 18th 06 12:28 AM
Is there any File Auto Save Function for Excel and Word 2007 (Bet Mr. Low Excel Worksheet Functions 2 June 16th 06 12:26 PM
how do i create a drop down list of items from a different file Profnutbutter Excel Worksheet Functions 3 March 31st 06 08:00 PM
when opening a .xls file it seems to want to open in word, what d deniseh Excel Discussion (Misc queries) 4 March 17th 06 01:50 PM
Excel startup switches Randy Excel Discussion (Misc queries) 9 June 14th 05 10:27 PM


All times are GMT +1. The time now is 11:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"