Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Programmatically open XLT for edit and stop macros

Using Office 2003 and Windows XP;

I have a template file that I need to open for editing using automation
(late binding) and in doing so, I want to programmatically prevent macros
from firing. My code so far:

Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(sFullName)

Can someone please post example code and/or modify my code to achieve this?

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Programmatically open XLT for edit and stop macros

Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
oxl.EnableEvents = False
Set oWB = oXL.Workbooks.Open(FileName:=sFullName, _
Editable:=True)

--
Regards,
Tom Ogilvy

"XP" wrote:

Using Office 2003 and Windows XP;

I have a template file that I need to open for editing using automation
(late binding) and in doing so, I want to programmatically prevent macros
from firing. My code so far:

Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(sFullName)

Can someone please post example code and/or modify my code to achieve this?

Thanks much in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Programmatically open XLT for edit and stop macros

Hi Tom,

It's odd but that doesn't work for me with automation. Events are disabled
OK but then are re-enabled when opening the wb allowing the wb's Open event
to run.

Regards,
Peter T



"Tom Ogilvy" wrote in message
...
Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
oxl.EnableEvents = False
Set oWB = oXL.Workbooks.Open(FileName:=sFullName, _
Editable:=True)

--
Regards,
Tom Ogilvy

"XP" wrote:

Using Office 2003 and Windows XP;

I have a template file that I need to open for editing using automation
(late binding) and in doing so, I want to programmatically prevent

macros
from firing. My code so far:

Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(sFullName)

Can someone please post example code and/or modify my code to achieve

this?

Thanks much in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Programmatically open XLT for edit and stop macros

That would be the case in xl2000 and earlier as I recall. In xl2002 and
later I believe it was fixed.

Are you using one of these earlier versions?

--
Regards,
Tom Ogilvy


"Peter T" wrote:

Hi Tom,

It's odd but that doesn't work for me with automation. Events are disabled
OK but then are re-enabled when opening the wb allowing the wb's Open event
to run.

Regards,
Peter T



"Tom Ogilvy" wrote in message
...
Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
oxl.EnableEvents = False
Set oWB = oXL.Workbooks.Open(FileName:=sFullName, _
Editable:=True)

--
Regards,
Tom Ogilvy

"XP" wrote:

Using Office 2003 and Windows XP;

I have a template file that I need to open for editing using automation
(late binding) and in doing so, I want to programmatically prevent

macros
from firing. My code so far:

Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(sFullName)

Can someone please post example code and/or modify my code to achieve

this?

Thanks much in advance.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Programmatically open XLT for edit and stop macros

That explains it, I was using XL2000.

FWIW, even in XL2000 disabling events within own instance does persist and
prevents a wb's open event firing, but not with automation.

Regards,
Peter T

"Tom Ogilvy" wrote in message
...
That would be the case in xl2000 and earlier as I recall. In xl2002 and
later I believe it was fixed.

Are you using one of these earlier versions?

--
Regards,
Tom Ogilvy


"Peter T" wrote:

Hi Tom,

It's odd but that doesn't work for me with automation. Events are

disabled
OK but then are re-enabled when opening the wb allowing the wb's Open

event
to run.

Regards,
Peter T



"Tom Ogilvy" wrote in message
...
Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
oxl.EnableEvents = False
Set oWB = oXL.Workbooks.Open(FileName:=sFullName, _
Editable:=True)

--
Regards,
Tom Ogilvy

"XP" wrote:

Using Office 2003 and Windows XP;

I have a template file that I need to open for editing using

automation
(late binding) and in doing so, I want to programmatically prevent

macros
from firing. My code so far:

Dim oXL as Object
Dim oWB as Object
Dim sFullName = "fully qualified path to my file.xlt"
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(sFullName)

Can someone please post example code and/or modify my code to

achieve
this?

Thanks much in advance.






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
VSTO and Excel-- End Cell Edit Mode Programmatically? [email protected] Excel Programming 2 July 25th 06 06:47 AM
How to stop file open macro prompt after deleting all macros? twor57 Excel Worksheet Functions 2 November 29th 05 05:00 PM
How to edit VB code programmatically Jon Excel Programming 1 March 9th 05 11:44 PM
How to stop having to re-assign macros every time you open a workbook??? Simon Lloyd[_533_] Excel Programming 3 August 16th 04 03:27 AM
Programmatically open / edit vba-editor hglamy[_2_] Excel Programming 1 September 4th 03 03:32 PM


All times are GMT +1. The time now is 11:59 AM.

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

About Us

"It's about Microsoft Excel"