PC Review


Reply
Thread Tools Rate Thread

Accessing an Excel file which has macros

 
 
jamesp@premiercs.co.uk
Guest
Posts: n/a
 
      13th Jan 2009
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
 
Reply With Quote
 
 
 
 
Maury Markowitz
Guest
Posts: n/a
 
      13th Jan 2009
On Jan 13, 10:33*am, jam...@premiercs.co.uk
<jamesppremiercsc...@discussions.microsoft.com> 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
 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      13th Jan 2009

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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"(E-Mail Removed)" <(E-Mail Removed)>
wrote in message news:1B222D42-FC28-4F63-B5AF-(E-Mail Removed)...
>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


 
Reply With Quote
 
jamesp@premiercs.co.uk
Guest
Posts: n/a
 
      13th Jan 2009
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, jam...@premiercs.co.uk
> <jamesppremiercsc...@discussions.microsoft.com> 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
>

 
Reply With Quote
 
jamesp@premiercs.co.uk
Guest
Posts: n/a
 
      13th Jan 2009
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)
>
>
> (E-Mail Removed);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
>
>

 
Reply With Quote
 
jamesp@premiercs.co.uk
Guest
Posts: n/a
 
      13th Jan 2009
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
> afterwards!(E-Mail Removed);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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros: "Error Accessing File. Network Connection May Have Been Lo R23 Microsoft Access 1 9th May 2008 03:16 PM
Accessing Excel 2007 Userforms from Macros =?Utf-8?B?QnJhZCBXeWxpZQ==?= Microsoft Excel Programming 16 4th Mar 2007 07:28 PM
Accessing Excel Macros from VB.Net =?Utf-8?B?U2FtZWVy?= Microsoft Excel Programming 2 17th Aug 2006 08:26 AM
accessing .mpp file using excel VBA macros amit Microsoft Excel Programming 0 10th Nov 2005 09:44 AM
Excel/automation Gurus., please help... extract macros from excel and adding new macros into an excel sheet. OhMyGaw Microsoft C# .NET 3 10th Aug 2005 01:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:21 PM.