×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Opening an Excel file from Extra!

Opening an Excel file from Extra!

Opening an Excel file from Extra!

(OP)
Hello,

I created a macro which automatically starts when the excel file is opened. I need to be able to start this macro from within Extra! and so I created a macro with the following code to do this:

CODE

set xl = CreateObject("Excel.Application")
    If dir("H:\My documents\Comptes\INNS.xls") > "" then
        set wb = xl.Workbooks.Open("H:\My documents\Comptes\INNS.xls")
        xl.visible = true
    Else
        msgbox ("Make sure you have a copy of INNS.xls in your  Documents folder.")
        xl.Quit
    End if

I can see the window open, but the Excel macro doesn't start. When I open the Excel file myself, the macro runs every time.

I wasn't sure if this should be in the Attachmate forum or here.

Does anyone have any suggestions?

RE: Opening an Excel file from Extra!



hi,

You program stuff in Excel VBA.  You program stuff in Extra VBA.

Have you noticed the difference?

Let's say you have to get two automobiles from New York to LA.  You can drive the Pinto and tow the Lamborghini, or drive the Lamborghini and tow the Pinto.

Hmmmmmmmmmm??????
 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Opening an Excel file from Extra!

(OP)
I agree with you on that, however since I work mainly in Extra! and have to scrape the information from Extra! into Excel, it will save me extra steps if I open the Excel file from Extra!. I haven't found a way to create a short-cut key in Extra! to open an Excel file. Is there a way to do this?

RE: Opening an Excel file from Extra!




There seems to be a difference between opening an Excel workbook from Access or Extra, in that the user has not answered the macro security question via Extra.

Let me understand.  You mainly run stand-alone Extra macros, that interface with no other MS applications?

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Opening an Excel file from Extra!

(OP)
That's right. This is the first Extra macro that I've ever create which "calls" an Excel file. You mentionned in your response a macro security question... I haven't seen the pop-up that asks the question.

Is there a way then, to answer the question with the Extra macro?

RE: Opening an Excel file from Extra!



No, otherwise ANYONE could write a macro to defeat this kind if security, which is why it is there in the first place: to keep out his kind of intrusion!!!

Can't have it both ways.

Of course, you could just set the LOWEST macro security in Excel and then you could.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Opening an Excel file from Extra!

(OP)
I tried this, and it works:

CODE

'$Cstrings
dim x
x = Shell("\"C:\\Program Files\\Microsoft Office\\OFFICE14\\EXCEL.EXE\" \"G:\\Macros\\INNS3\\INNS_Fr.xls\"",1)

The first time I opened the file it asked me if I wanted to enable the macros. I accepted. The second I opened it, it ran the macro automatically.

RE: Opening an Excel file from Extra!



I drive a Lamborghini!  winky smile

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close