How to use macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I have some work that need to be done on every Thursday so I am thinking if
it is possible to write a macro to do all these things automatically. Below
is what I need to do:

1. I will receive an email with a particular title "test" on every thur
morning
2. there is an attachment with this email (a zipped excel file)
3. save and unzip on desktop
4. open the excel file and do some data analysis (calculation, pivot table
and graphs, etc
5. copy the graphs to a powerpoint file
6. zip the file and email to a group of people (using outlook)

I would like to ask:

1. the only way I know to write a macro is using the "record a new macro"
function in excel. Is there any other way to do that?
2. How to save the macro as a separate file? It is because everytime after
recording a macro, I can only save it within the excel file.
3. how to use macro to operate excel, word, powerpoint, outlook, IE?
4. can I write a macro to search for an email with a particular subject in
outlook?
5. Besides this newgroup, can anyone give me some great website which
provides very practical tutorials in using macro?

I am not an expert in using macro. I know that there are a lot of questions
and I would greatly appreciate for your help.

Cheers,
Jackie
 
Hi,

The main way of writing macros is not using the macro recorder, but writing
them directly in the macro editor. The macro recorder can only generate very
simple macros and its code is usually not very good. Most people use the
recorder only as a quick way to recall or learn how to write a certain action
in VBA code. But if you have never programmed before, it will prove very
difficult to write your own macros. To access the editor go to Tools > Macros
Visual Basic Editor.

From the editor you will also be able to export (save) the macros
independently from the Excel sheet. To do so click on File > Export File. The
code will be saved as a file with .bas extension, which is the visual basic
source code extension. You don't need the Editor to open these files, as they
can be opened and edited using any text editor (Notepad, Wordpad, Edit, ...).

All the things you describe (opening files from one Office program using
another Office program and manipulating its contents and so on) can be done,
but it is quite a high level of programming and knowledge of the different
Object Models underlying each application.

The best way to start is having a look at the VBA help included in Excel.
You can access it from the Visual Basic Editor.

Regards,

Alex Guardiet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top