Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to move stored string value from Outlook to Excel

Status
Not open for further replies.

Groom84

Technical User
Feb 27, 2009
19
SE
Hi
I need to move my stored string value in Outlook, to a cell (any cell) in Excel.

But I have trouble to insert the value to the excel.

I don't want to do the cheesy way of copying the word to clipboard and paste the text to excel.

Lets start with this easy code (how should I proceed?):

Code:
Sub test()
Dim TestString1 As String

TestString1 = "To be inserted to any cell"

Dim appExcel As New Excel.Application
Set appExcel = CreateObject("Excel.Application")



End Sub



Thanks in advance.
BR
Groom
 


Hi,

I like bleu cheese!
Code:
Sub test()
Dim TestString1 As String

TestString1 = "To be inserted to any cell"

Dim appExcel As New Excel.Application
Set appExcel = CreateObject("Excel.Application")

with appExcel.Workbooks.Add
   .sheets(1).Cells(1.1).value = TestString1
end with

End Sub

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi
Thanks for the help.
I have a problem here now, the (excel) window does not show up. The applications is running but cant locate the window.

And I cant use:

Code:
appExcel.display

Is there some way to bring the application visible?



Also, if I don't want a new Excel app to be open each time I run the macro, can I have it work on existing?
 
appExcel.Visible = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I solved this:

Code:
Dim appExcel As Excel.Application
Set appExcel = GetObject(, "Excel.Application")
appExcel.Visible = True


With appExcel.ActiveWorkbook
  .Sheets(1).Cells(m, n).Value = TestString1
  End With
  
appExcel.Visible = True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top