PDA

View Full Version : Automatically play CD, open it's .xls file & save it in Excel default directory



mikeburg
05-12-2011, 09:58 AM
(1) How can I cause a file on a CD to automatically play the CD & open the .xls file in excel when it's loaded in a drive of a computer that has excel loaded?

(2) Once the excel file opens, what would be the Auto Open VBA to save it in that particular computer's excel default directory?

(3) Is there a way to not have Auto Open VBA try to run if a computer's security is set too high (open the file without running Auto Open)?

I hope these 3 questions are related enough to be in one post.

Thanks a million for any help. mikeburg

JP2112
05-12-2011, 01:08 PM
(1) If autorun is enabled, you can do something like this:

http://autorun.moonvalley.com/autoruninf.htm

(2) What do you mean "excel default directory" -- the folder where Excel is installed?

(3) What do you mean "computer's security" -- do you mean Excel's macro security? If it's set to High, only signed macros from trusted sources will run.

mikeburg
05-16-2011, 08:17 AM
JP,

(1) Thanks, this is what I needed.
Sorry I did not make myself clear.
(2) I meant the excel's data directory, in my case z:\data\msexcel but others that open the file may have a different Excel data directory. I am trying to get the VBA that will save the doc after I get Yes to Save the new file using an Input box.
(3) Yes, I was asking about when the macro security setting is set to medium or high (instead of Low), to not run the macro

Thanks for your help. I am still trying to learn VBA for Excel. mikeburg