Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2004, 05:57 AM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening an Excel workbook i n append mode

hi,
I would like to know how to open an excel workbook in append mode(read/write mode) through code.
When i give

xlappdest.WorkBooks.Open(destfile)

wrote code to write some values into the sheet


xlappdest.ActiveWorkbook.Save
xlappdest.ActiveWorkbook.Close

But in the .Save line it's throwing up an error that the file (destfile) is opened only in
read mode and i can save only a copy of it.

How do i rectifiy this.

Thanks
sumanth


 
Old February 25th, 2004, 12:44 PM
Authorized User
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I open/write/close files all the time with VBA code, and the only time I can't save changes is when the file is marked read only within the file system, or someone has set the internal "Read Only Recommended" option. Do you have either of these situations? If the first, you need to turn off the read only option (which can be doen programmatically a couple of ways). If the second, I believe this option can be turned off programmatically, as long as the password is not also set.

Dave
 
Old February 25th, 2004, 11:35 PM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by virtualdave
 I open/write/close files all the time with VBA code, and the only time I can't save changes is when the file is marked read only within the file system, or someone has set the internal "Read Only Recommended" option. Do you have either of these situations? If the first, you need to turn off the read only option (which can be doen programmatically a couple of ways). If the second, I believe this option can be turned off programmatically, as long as the password is not also set.

Dave
hi dave,
how will you programmatically uncheck or disable the recommend Read only option in Excel.
thanks
sumanth

 
Old March 5th, 2004, 02:54 PM
Authorized User
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Workbooks.Open Filename:="Test.xls", IgnoreReadOnlyRecommended:=True


Dave
 
Old May 13th, 2004, 09:23 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dave can you help me out,
I am wanting to know how to write code to make a file read only...

Thanks Alot,

Jason






Similar Threads
Thread Thread Starter Forum Replies Last Post
on opening workbook, how to disable macro ? jjk2 Beginning VB 6 1 January 7th, 2008 05:05 AM
Unable to import from an Excel Workbook donevco Access 7 April 27th, 2007 09:37 AM
Opening Text file in Binary mode for reading lawsoncobol Access VBA 1 August 3rd, 2006 04:01 AM
Closing Excel Workbook rekha_jsr Excel VBA 0 July 9th, 2005 02:40 AM
ComboBox Click even firing when opening workbook bennyD Excel VBA 0 March 2nd, 2004 05:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.