|  | SendObject |  | |
| | | Vincdc |  |
| Posted: Fri Sep 19, 2008 8:44 pm Post subject: SendObject |  |
I want to use "SendObject" Macro to send a query into Excel spreadsheet. However, I found this one does not work. When I run the macro, it does not send the query by email. Any suggestion? Thanks in advance!
Vincent |
| |
| | | Tom Wickerath |  |
| Posted: Sat Sep 20, 2008 11:06 pm Post subject: RE: SendObject |  |
Hi Vincent,
Which version of Access are you using? What does your macro look like? List the Action(s), any conditions, and the following properties:
Object Type Object Name Output Format To Cc Bcc Subject Message Text Edit Message and Template File
Verify that the ObjectName is valid.
Tom Wickerath Microsoft Access MVP LINK LINK __________________________________________
"Vincdc" wrote:
| Quote: | I want to use "SendObject" Macro to send a query into Excel spreadsheet. However, I found this one does not work. When I run the macro, it does not send the query by email. Any suggestion? Thanks in advance!
Vincent |
|
| |
| | | Vincdc |  |
| Posted: Mon Sep 22, 2008 1:55 pm Post subject: RE: SendObject |  |
Hi Tom, I am using Access2002. Object Type is table. Object Name is the name of table I want to send out. Output Format is Excel. .... I did not use a template file and did not set any conditions for the macro. I am wondering if there is anything to do with my Outlook. Do I need to configure my Outlook settings? Thanks a lot!
Vincent
"Tom Wickerath" wrote:
| Quote: | Hi Vincent,
Which version of Access are you using? What does your macro look like? List the Action(s), any conditions, and the following properties:
Object Type Object Name Output Format To Cc Bcc Subject Message Text Edit Message and Template File
Verify that the ObjectName is valid.
Tom Wickerath Microsoft Access MVP LINK LINK __________________________________________
"Vincdc" wrote:
I want to use "SendObject" Macro to send a query into Excel spreadsheet. However, I found this one does not work. When I run the macro, it does not send the query by email. Any suggestion? Thanks in advance!
Vincent |
|
| |
| | | Tom Wickerath |  |
| Posted: Mon Sep 22, 2008 4:32 pm Post subject: RE: SendObject |  |
| |  | |
Hi Vincent,
Try converting your macro to VBA code, and then post the code into a reply to this newsgroup. Off-hand, I don't see anything wrong with what you are doing, but perhaps seeing the equivalent code will reveal something. To convert your macro to VBA code, close the macro first. Then select it in the Database Window, and click on Tools | Macro | Convert Macros to Visual Basic...
This command will convert all macros within a macro group to VBA code. (The macro group may contain one or more macros).
You shouldn't need to configure anything in Outlook.
Tom Wickerath Microsoft Access MVP LINK LINK __________________________________________
"Vincdc" wrote:
| Quote: | Hi Tom, I am using Access2002. Object Type is table. Object Name is the name of table I want to send out. Output Format is Excel. ... I did not use a template file and did not set any conditions for the macro. I am wondering if there is anything to do with my Outlook. Do I need to configure my Outlook settings? Thanks a lot!
Vincent |
|
| |
| | | Vincdc |  |
| Posted: Mon Sep 22, 2008 5:06 pm Post subject: RE: SendObject |  |
| |  | |
Hi Tom, It works in the VB mode. I think that I will use the VB mode then. Thanks a lot!
Vincent
"Tom Wickerath" wrote:
| Quote: | Hi Vincent,
Try converting your macro to VBA code, and then post the code into a reply to this newsgroup. Off-hand, I don't see anything wrong with what you are doing, but perhaps seeing the equivalent code will reveal something. To convert your macro to VBA code, close the macro first. Then select it in the Database Window, and click on Tools | Macro | Convert Macros to Visual Basic...
This command will convert all macros within a macro group to VBA code. (The macro group may contain one or more macros).
You shouldn't need to configure anything in Outlook.
Tom Wickerath Microsoft Access MVP LINK LINK __________________________________________
"Vincdc" wrote:
Hi Tom, I am using Access2002. Object Type is table. Object Name is the name of table I want to send out. Output Format is Excel. ... I did not use a template file and did not set any conditions for the macro. I am wondering if there is anything to do with my Outlook. Do I need to configure my Outlook settings? Thanks a lot!
Vincent |
|
| |
| | | Tom Wickerath |  |
| Posted: Mon Sep 22, 2008 9:29 pm Post subject: RE: SendObject |  |
| |  | |
Hi Vincent,
I'm glad to read of your success. Personally, I much prefer using VBA code over macros, even given the improvements that Microsoft has made to macros in A2007. In Access 2003 and all prior versions, one cannot trap for errors and handle them gracefully when using macros. Any errors that occur will cause a really ugly macro error dialog to be presented to your users. The newest version of Access, Access 2007 allows for error trapping, so macros are more appropriate to consider using for Access applications created with Access 2007.
Consider the following quote:
From: "Inside Relational Databases, 2nd Edition, by Mark Whitehorn and Bill Marklyn, published by Springer, p 151
"Macros offer the next level down, extending the functionality of the GUI. Macros are still limited, however, and do not provide anything like the enormous flexibility of a programming language. Both the macro and the programming languages take some effort to learn and, surprisingly, often require relatively different skills; in other words, a good working knowledge of macros may not make it much easier to convert to using the programming language. Perhaps even more surprisingly, I do not believe that programming is fundamentally more difficult to learn. Macros are easier to use but not by orders of magnitude."
"If you are new to RDBMSs, I suggest (with as much deference as possible) that you may well not be in a position to judge whether you need macros or programming. In that case, my advice is clear. Unless you are sure that your needs really are simple, don't bother learning to use macros. Once you find that you need more than the GUI offers, go straight to the programming language. In this way you avoid the pain of climbing one learning curve only to discover that the view from the top is unsatisfactory and another climb awaits you."
Tom Wickerath Microsoft Access MVP LINK LINK __________________________________________
"Vincdc" wrote:
| Quote: | Hi Tom, It works in the VB mode. I think that I will use the VB mode then. Thanks a lot!
Vincent |
|
| |
|
|