ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing an Excel file which has macros (https://www.excelbanter.com/excel-programming/422385-accessing-excel-file-has-macros.html)

[email protected]

Accessing an Excel file which has macros
 
I have written some code which opens another file which has macros and
extracts data. I don't need to run any macros in this other file. Is there
a way of turning off the button to run macros when the other file opens up?
Also I'm doing this in 2003 at the mo but is there any difference with 2007?

Many thanks

James

Maury Markowitz[_2_]

Accessing an Excel file which has macros
 
On Jan 13, 10:33*am,
wrote:
I have written some code which opens another file which has macros and
extracts data. *I don't need to run any macros in this other file. *Is there
a way of turning off the button to run macros when the other file opens up? *


Which button are you referring to? Is this a button that you have
placed in a sheet, or the menu item under Tools and it's counterpart
in the Toolbar. If it's the later, your best bet is to simply remove
the Macro Toolbar from the machines where this might be run.

Maury

Don Guillett

Accessing an Excel file which has macros
 

Button?
What and where is this macro and what kind of button.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"
wrote in message ...
I have written some code which opens another file which has macros and
extracts data. I don't need to run any macros in this other file. Is
there
a way of turning off the button to run macros when the other file opens
up?
Also I'm doing this in 2003 at the mo but is there any difference with
2007?

Many thanks

James



Charlie[_19_]

Accessing an Excel file which has macros
 

Hi,

Try to put these lines at the beginning and end of your code:

Application.DisplayAlerts = False

Your code to open other file....

Application.DisplayAlerts = true

Charlie
'Opener Consulting Home' (http://www.openerconsulting.com)


;180058 Wrote:
I have written some code which opens another file which has macros and
extracts data. I don't need to run any macros in this other file. Is
there
a way of turning off the button to run macros when the other file opens
up?
Also I'm doing this in 2003 at the mo but is there any difference with
2007?

Many thanks

James



--
Charlie
------------------------------------------------------------------------
Charlie's Profile:
http://www.thecodecage.com/forumz/member.php?userid=89
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=49795


Simon Lloyd[_971_]

Accessing an Excel file which has macros
 

You could use this line of code but you need to be more specific on what
button where.

Code:
--------------------
Application.EnableEvents = False
--------------------
you would have to tie it in with an IF statement so it will only be used
on a certain sheet or workbook!, don't forget to turn it back on
;180058 Wrote:
I have written some code which opens another file which has macros and
extracts data. I don't need to run any macros in this other file. Is
there
a way of turning off the button to run macros when the other file opens
up?
Also I'm doing this in 2003 at the mo but is there any difference with
2007?

Many thanks

James



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=49795


[email protected]

Accessing an Excel file which has macros
 
It comes up when you try to open the file and before it opens you get the
'Security warning' dialog box with 'Macros may contain viruses...' and then
the user has to click on either the 'Disable macros' or 'Enable Macros'
button to open.

Programically, i don't want to see this dialog box.

Does this make sense?

Thanks

James

"Maury Markowitz" wrote:

On Jan 13, 10:33 am,
wrote:
I have written some code which opens another file which has macros and
extracts data. I don't need to run any macros in this other file. Is there
a way of turning off the button to run macros when the other file opens up?


Which button are you referring to? Is this a button that you have
placed in a sheet, or the menu item under Tools and it's counterpart
in the Toolbar. If it's the later, your best bet is to simply remove
the Macro Toolbar from the machines where this might be run.

Maury


[email protected]

Accessing an Excel file which has macros
 
Spot on Charlie

Many thanks

James

"Charlie" wrote:


Hi,

Try to put these lines at the beginning and end of your code:

Application.DisplayAlerts = False

Your code to open other file....

Application.DisplayAlerts = true

Charlie
'Opener Consulting Home' (http://www.openerconsulting.com)


;180058 Wrote:
I have written some code which opens another file which has macros and
extracts data. I don't need to run any macros in this other file. Is
there
a way of turning off the button to run macros when the other file opens
up?
Also I'm doing this in 2003 at the mo but is there any difference with
2007?

Many thanks

James



--
Charlie
------------------------------------------------------------------------
Charlie's Profile:
http://www.thecodecage.com/forumz/member.php?userid=89
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=49795



[email protected]

Accessing an Excel file which has macros
 
A bit picky but I like where you're coming from :-)

"Simon Lloyd" wrote:


You could use this line of code but you need to be more specific on what
button where.

Code:
--------------------
Application.EnableEvents = False
--------------------
you would have to tie it in with an IF statement so it will only be used
on a certain sheet or workbook!, don't forget to turn it back on
;180058 Wrote:
I have written some code which opens another file which has macros and
extracts data. I don't need to run any macros in this other file. Is
there
a way of turning off the button to run macros when the other file opens
up?
Also I'm doing this in 2003 at the mo but is there any difference with
2007?

Many thanks

James



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=49795



Simon Lloyd[_972_]

Accessing an Excel file which has macros
 

It wasn't meant to be picky, sorry it seemed that way! ;180310 Wrote:
A bit picky but I like where you're coming from :-)

"Simon Lloyd" wrote:


You could use this line of code but you need to be more specific on

what
button where.

Code:
--------------------
Application.EnableEvents = False
--------------------
you would have to tie it in with an IF statement so it will only be

used
on a certain sheet or workbook!, don't forget to turn it back on
;180058 Wrote:
I have written some code which opens another file which has macros

and
extracts data. I don't need to run any macros in this other file.

Is
there
a way of turning off the button to run macros when the other file

opens
up?
Also I'm doing this in 2003 at the mo but is there any difference

with
2007?

Many thanks

James



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: 'Accessing an Excel file which has macros - The

Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...ad.php?t=49795)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=49795



All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com