Computing.Net > Forums > Programming > Load/Run an offline VBA Marco for E

Load/Run an offline VBA Marco for E

Reply to Message Icon

Original Message
Name: RB
Date: April 5, 2003 at 07:46:41 Pacific
Subject: Load/Run an offline VBA Marco for E
OS: win2k pro
CPU/Ram: P4 1.5 /512
Comment:

Hello All,

Is it possible to write an VB Marco for Excel offline...
(Here is the real Question)
Then load and run that macro in Excel without having to go to Tool>Marco>Create Menu...then pasting the macro in???

What I'm trying to do is extract tool data from a CAM package and read it directly into excel. This tool data changes for each job that why I wanted to write the macro offline.
I have a sheet template for the placement of this data.

The macro works fine if I use the paste method...
but others will be using this and that wouldn't be a very productive method.

If excel kept it's macros on the drive somewhere I could constantly over write that file...
but I don't think excel works that way.

I'm kind of new at this VB/Excel.

Any help is appreciated.

Thanks
RB


Report Offensive Message For Removal


Response Number 1
Name: egkenny
Date: April 5, 2003 at 18:00:16 Pacific
Reply: (edit)

Couldn't you just create a menu that loads when you load the workbook. This workbook has no data but is created to just hold the menu. The menu has selections that run VBA macros. Here is an example: http://mywebpages.comcast.net/egkenny/images/TestDialog2.jpg

If this is not what you mean then explain furthur.


Report Offensive Follow Up For Removal

Response Number 2
Name: RB
Date: April 7, 2003 at 18:34:34 Pacific
Reply: (edit)

Sorry for the slow response...
To answer your question...I'm not sure.
Can this be done to load a marco written from a txt file???
The only way I found to add /or load a macro is through menu>Tool>Macro>Create.
This creates a macro inside the workbook at that time.
I want to create it outside of excel but run it with in.

I'm not sure we are talking about the same thing based on yur example.

Could you give me a excel example??

Thanks for your help.
RB


Report Offensive Follow Up For Removal

Response Number 3
Name: egkenny
Date: April 9, 2003 at 14:41:49 Pacific
Reply: (edit)

The menu "Tools / Macro" menu has three options of interest:
"Macros" is used to run, edit, create, delete Macro programs.
"Record New Macro" is used to record keystroke commands in a Macro program.
"Visual Basic Editor" is used to create macro programs made up of a mixture of Macro and Visual Basic commands.

The "Visual Basic Editor" has two modes: Object and Code. In object mode you view the normal spreadsheet. In code mode you view the code associated with the Workbook and Worksheet objects. Each Worksheet you have has a code module in which you can add your code. The Workbook (which includes all the Worksheets) has its own module. You can add your own code modules which are independent of the Workbook and Worksheets modules.

The Macro code in these modules is made of Macro and Visual Basic commands. Macro commands perform the same result as using keyboard and menu options on the spreadsheet. Visual Basic commands duplicate some these Macro commands and perform many programming functions not possible with Macros alone.

Some code can be execute automatically when the Workbook is opened but that would be very limiting. You can also add many the following normal program Objects to your Worksheets from the Toolbox: Labels, Text Boxes, Push Buttons, Checkboxes, Option Buttons, List Boxes, Combo Boxes, Toggle Button, Spin Button, Scroll Bars, and Images. Each of these Objects is asscocated with Macro code in a module.

Code Modules are normally created and edited with the built-in "Visual Basic Editor" but you can import externally create code created with normal text editors such as Notepad. You use the menu item "File / Import File" to do this. Code Modules can also be saved to a normal text file by using the menu option "File / Export File". Even if the code is created outside Excel it still must be imported to be used.

If you have a particular type of program example in mind let me know and I will post it here or on my Web site.


Report Offensive Follow Up For Removal

Response Number 4
Name: bmkbailey
Date: April 14, 2003 at 18:25:41 Pacific
Reply: (edit)


Again...sorry for the slow response.
Busy.
I just to say thanks for the good info.
I think I have figured out what I need to do to bring in my data.

Thanks again
RB


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Load/Run an offline VBA Marco for E

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes Today.
Discuss in The Lounge