Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default vba equivalent of an autorun xlm file

A stand-alone autorun xlm file, when clicked, will automatically
run the macro. Is there a vba equivalent of such thing? All the
script files (.bas) I created, when clicked, ask me to choose a
program to open them. And when I choose Excel, Excel simply opens
the files but does not run the macro.

What do I need to do to be able to double-click a vba file and run
the macro, without running Excel first?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default vba equivalent of an autorun xlm file

vbscript ?

or create an excel file containing the macro and link it to the workbook_open event

--
Tim Williams
Palo Alto, CA


"John Smith" wrote in message ...
A stand-alone autorun xlm file, when clicked, will automatically
run the macro. Is there a vba equivalent of such thing? All the
script files (.bas) I created, when clicked, ask me to choose a
program to open them. And when I choose Excel, Excel simply opens
the files but does not run the macro.

What do I need to do to be able to double-click a vba file and run
the macro, without running Excel first?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default vba equivalent of an autorun xlm file

John,
Basically, you can't. VBA need a container to run in, Excel in this case.
VBA is designed to interact with its host and if that host does not exist,
it cannot function.

Depending on what you are trying to do (that does not involve Excel),
VBScript may be suitable.
These can be run "standalone".

NickHK

"John Smith" wrote in message
...
A stand-alone autorun xlm file, when clicked, will automatically
run the macro. Is there a vba equivalent of such thing? All the
script files (.bas) I created, when clicked, ask me to choose a
program to open them. And when I choose Excel, Excel simply opens
the files but does not run the macro.

What do I need to do to be able to double-click a vba file and run
the macro, without running Excel first?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default vba equivalent of an autorun xlm file

You could create a normal workbook (.xls file) and put the code into a General
module.

Name the procedure Auto_Open.

John Smith wrote:

A stand-alone autorun xlm file, when clicked, will automatically
run the macro. Is there a vba equivalent of such thing? All the
script files (.bas) I created, when clicked, ask me to choose a
program to open them. And when I choose Excel, Excel simply opens
the files but does not run the macro.

What do I need to do to be able to double-click a vba file and run
the macro, without running Excel first?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autorun.inf Pam Excel Programming 2 October 17th 05 06:56 PM
How do you make a backup file - .bak or MS equivalent? Terry_BWL New Users to Excel 4 January 3rd 05 11:12 PM
Autorun Macro on file opening Sha-auto[_2_] Excel Programming 1 October 27th 04 04:31 PM
Autorun Macro on file opening Sha-auto Excel Programming 3 October 26th 04 03:53 AM
Autorun Add-In A.M Excel Programming 2 September 21st 04 04:19 PM


All times are GMT +1. The time now is 11:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"