• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro

TonyNZ

Member
I am somewhat familiar with creating macros, and they work perfectly well within the Excel Application.

This is what I want to do:
Create some data and saved, file closed.

Record a Macro in Excel and take these steps:
1) Start recording (from the Developer tool)
2) Open the folder where file is saved
3) Create a shortcut to this file
4) Drag this shortcut and put on the Start button (in Windows XP)
5) Stop recording

When I execute this macro, it doesnt work; I am guessing Macros work only within the Excel application and not in the scenario above.

If wont work with excel macro, do you suggest any solution.

Many thansk
 
Good day TonyNZ
Have you opened the macro and looked at the code to see what is there
 
I am very novice in Macros; don't really know reading the code yet.
If you can just let me know that whether this is workable or not; whether Macros in Excel can perform such functions or not. If yes, then I will spend some time and work on this but if this is simply not permissible and macros doesnt work like that, I prefer not to spend time on something which ultimately is not gonna work; hope this make sense.
many thanks
 
Hi Tony

This seems to be what you are trying to do, ignoring what you have done to get there.

Create some data

Save the file

Close the file

If this is all you want to do then yes it is very possible. Here is some basic code typed directly in here so appologies for any typos.

Code:
Sub xxy()
 
[a1:b2] = [{"header1", "header2"; 10,20}] 'Data for A1 to B2
activeWorkbook.saveas "C:\Test.xls" 'Save the workbook to a drive
activeWorkbook.close false 'Close workbook without saving
end sub

This will save the current workbook with some basic data in Cells A1 to B2. If this is all you are looking to do then yes XL handles this well.

Take care

Smallman
 
Hi, TonyNZ!

If the provided macro it's what you're asking for, the only issue remaining it'd be the shorcut. Regarding the shortcut, I have these doubts:

a) When you say:
3) Create a shortcut to this file
4) Drag this shortcut and put on the Start button (in Windows XP)
you tried to mean creating a shortcut in the recent used files start menu list, in the toolbar or in the desktop?
Since start button can't hold any link to any file, MRU (most recently used) programs list can hold just programs (applications, .exe) and not data files.

b) When you say:
5) Stop recording
why should be Excel recording a macro at that point?

Regards!
 
Back
Top