PC Review


Reply
Thread Tools Rate Thread

Re: From Word give over a date into Excel....

 
 
Max
Guest
Posts: n/a
 
      30th Jun 2003
Hi,

if I understood you correctly, you are trying to write a variable or value
from Word into an Excel book. Try this in Word:

Sub WriteValueToExcel()
Dim XL As New Excel.Application
Dim WB As Workbook
Set XL = Excel.Application
Set WB = XL.Workbooks.Open("c:\sample.xls")
WB.Worksheets(1).Range("A1") = "Some text, value or variable"
WB.Close True
XL.Quit
Set XL = Nothing
End Sub

Where ...
"c:\sample.xls" is the path and file name of the workbook,
"Worksheets(1).Range("A1")" is the sheet and cell in the workbook you want
to fill and
"Some text, value or variable" is a string or variable to be written to
Excel.

Don't forget to reference the Excel lib in Word (menu "Tools .... References
.... Microsoft Excel X.X Object Library" in the Word VB-editor.

Regards
Max
(E-Mail Removed)



"Christoph" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> Hi,
>
> I would like to give a variable from Word into Excel so far I have this:
>
> Public Sub Verfallsdatum_Click()
> DatumEingeben
> DatumUbergeben
> End Sub
>
>
> Public Sub DatumEingeben()
>
> Dim Verfallsdate As Date
> On Error GoTo ErrorHandler
>
> Verfallsdate = InputBox("Bitte ein Verfallsdatum eingeben(TT.MM.JJJJ):")
>
>
>
> Exit Sub
> ErrorHandler:
>
> 'Set Verfallsdate = Nothing
> MsgBox ("Bitte geben Sie eine gültige Datumformat ein")
>
> End Sub
> Public Sub DatumUbergeben()
>
> Dim ObjXls
> Dim xlwks As Object
> Dim strfilename As String
> Dim strLocation
>
> strLocation = strpath + "\" + strfilename
> strpath = "C:\Documents and Settings\zka\Desktop\Projekt\Wr.
> Städtische\Dokuverwaltung"
> strfilename = "Datenuebergabe2.xls"
> Set ObjXls = CreateObject("Excel.application")
> Set xlwks = ObjXls.workbooks.Open(strLocation)
> xlwks.GetDate
>
>
> End Sub
>
> In excel:
>
> Public Sub getdate(Verfallsdate As Date)
> Stop
> End Sub
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Ver 2.0 Adding days to a date to give target date excluding weekends? michael.nilsen@sgs.com Microsoft Access Macros 1 30th Nov 2006 03:20 AM
Access Ver 2.0 Adding days to a date to give target date excluding weekends? Michael Microsoft Access Forms 2 19th Nov 2006 11:52 PM
Access Ver 2.0 Adding days to a date to give target date excluding weekends? michael.nilsen@sgs.com Microsoft Access VBA Modules 1 19th Nov 2006 02:06 PM
Give and take between Excel or Word form and Access =?Utf-8?B?TkI=?= Microsoft Access External Data 0 6th Oct 2006 06:48 PM
How do I give a hyperlink of TOC of Word in Excel =?Utf-8?B?SGF0dGk=?= Microsoft Excel Misc 1 6th Apr 2005 07:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 PM.