Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation Problems

Status
Not open for further replies.

CLee

Programmer
Jan 28, 2001
14
0
0
AU
OK. I have an excel spreadsheet and a vba subroutine called "DoOpenSourceFile" When run it reads a text file and processes a series of records. Ok so far.
I need to execute this inside of ms word.

I can use CreateObject to start an instance of excel and brin in my spreadsheet. I can set the property visible = true, so excel become visible.

Now I need to execute my excel subroutine. (Its not a recorded macro.)

Thank
Chris
 
I agree with dreamboat, you should be able to call the function from the open event of the workbook when it first opens
 
Thanks to Dreamboat and kruskovac,

I moved my code behind the sheet1 to a
module, changed a few private subs to public,
set the Open event to action the sub and
that did it.

Import to understand about SCOPE of vars, subs and functions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top