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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening an Excel file from Extra!

Status
Not open for further replies.

dvirgint

Programmer
Jun 28, 2010
85
CA
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?
 


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,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
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?
 



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,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
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?
 


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,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
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.
 


I drive a Lamborghini! ;-)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top