Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Avoid asking to open with macros

Hiya

I am copying a workbook from within Access and opening it... every time I do this it pulls up a prompt asking to allow macros or not. How do I bypass the prompt - it doesn't matter if the macros are activated or not (but preferrably yes)

Any ideas

Basil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Avoid asking to open with macros

Are you opening the workbook manually, with a macro, by linking?

The obvious answer is to lower the security level although that is
undesirable.

--
Regards,
Tom Ogilvy

"Basil" wrote in message
...
Hiya,

I am copying a workbook from within Access and opening it... every time I

do this it pulls up a prompt asking to allow macros or not. How do I bypass
the prompt - it doesn't matter if the macros are activated or not (but
preferrably yes).

Any ideas?

Basil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Avoid asking to open with macros

I'm opening it with this code (written in Access):
Master = "M:\RPH - Reporting\Reporting Components\Master External Patient Report.xls"
TargetFile = "M:\Patient Flow Team\External Reports\Patient Reports\" & ReferringTrust & ".xls"

an if dir(targetfile) then kill end if statement is here

FileCopy Master, TargetFile
Set XLObject = GetObject(TargetFile)
With XLObject
.Application.Visible = True
.Parent.windows(1).Visible = True
.Sheets(3).Range("A9").CopyFromRecordset rstpreop
.Sheets(3).Range("N1:P1").EntireColumn.Delete
.Sheets(2).Range("A9").CopyFromRecordset rstref
.Sheets(4).Range("A9").CopyFromRecordset rstbl
.Sheets(5).Range("A9").CopyFromRecordset rstip
.Sheets(6).Range("A9").CopyFromRecordset rstpostop

End With

etc...

I'm happy to lower whatever settings - but I have tried taking off the "macro virus protection" in the master file's options and it made no difference to the copy (the target file).

Thanks,

Basil
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Avoid asking to open with macros

Security is an Excel/Application level setting. It is not governed by
anything in the workbook.

--
Regards,
Tom Ogilvy

Basil wrote in message
...
I'm opening it with this code (written in Access):
Master = "M:\RPH - Reporting\Reporting Components\Master External

Patient Report.xls"
TargetFile = "M:\Patient Flow Team\External Reports\Patient

Reports\" & ReferringTrust & ".xls"

an if dir(targetfile) then kill end if statement is here

FileCopy Master, TargetFile
Set XLObject = GetObject(TargetFile)
With XLObject
.Application.Visible = True
.Parent.windows(1).Visible = True
.Sheets(3).Range("A9").CopyFromRecordset rstpreop
.Sheets(3).Range("N1:P1").EntireColumn.Delete
.Sheets(2).Range("A9").CopyFromRecordset rstref
.Sheets(4).Range("A9").CopyFromRecordset rstbl
.Sheets(5).Range("A9").CopyFromRecordset rstip
.Sheets(6).Range("A9").CopyFromRecordset rstpostop

End With

etc...

I'm happy to lower whatever settings - but I have tried taking off the

"macro virus protection" in the master file's options and it made no
difference to the copy (the target file).

Thanks,

Basil



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Avoid asking to open with macros

How can I change it? And can it be changed through a VBA procedure?


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Avoid asking to open with macros

The whole point is that it's for *security*

If it could be changed from VBA then it would be useless.

tim


"Basil" wrote in message
...
How can I change it? And can it be changed through a VBA procedure?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open file with macros David T Excel Discussion (Misc queries) 2 November 29th 07 06:23 PM
HELP !! Macros to autoexecute on open Wins07 Excel Discussion (Misc queries) 2 April 4th 07 10:16 PM
Can't Open Excel Files with Macros Charles A C Excel Discussion (Misc queries) 1 January 9th 07 03:52 AM
How to avoid opening an empty workbook every time I open a file? Nick Papadakis Setting up and Configuration of Excel 2 February 12th 06 11:55 AM
Open Worbook and Disable Macros DMc2005 Excel Discussion (Misc queries) 4 October 1st 05 07:23 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"