View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Neil Holden Neil Holden is offline
external usenet poster
 
Posts: 163
Default Best way using Macros

I've no idea how to do this in outlook so i'm doing it all in excel.

I'm really lost with this : (

All i need now is code to automatically open an excel sheet at a certain
time and update links and save and close without having to do anything.

Please help genius!! : )

Neil.

"Joel" wrote:

Not sure if you are writing the code in Excel or Outlook VBa

You need to have the code in a subroutine like this

Sub MySub
'enter your code here

end sub



"Neil Holden" wrote:

Hello again, i have created VB Code which should update certain cells and
save and close: The code is below but when I open the excel sheet its having
problems with the first word Set. Please help!

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Documents and
Settings\neil.holden\Desktop\Excel Schelduled Tasks\test-pulledthrough.xls")

objExcel.Application.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Test value"

objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close

objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit

"Joel" wrote:

If you need something done on a regular basis I would write the macro in
Outlook and not excel. the code will be very similar but you can't schedule
events in Excel.


You have two choices. One is to write all the code in Outlook. Two is to
write just the event in outlook and then have outlook open a workbook a run a
macro in the opened workbook.

"Neil Holden" wrote:

Morning all, I have an excel sheet which pulls certain information from
another excel on a regular basic and needs updating in order for all the
information to be pulled through.

Ideally, what I would like to achieve is to set a scheduled task for my
excel sheet to open at a certain time and automatically update the
information from the other excel sheet and automatically close.
Can some genius please tell me how I can do this?
Much appreciated.