Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Workbook.Open failure

I have a bunch of Excel files which I need to open and make some
formatting changes for printing.

There are a handful for which the Open method is failing.
The error info from the exception has proven to be useless. For most
when I open the file by hand in Excel there are various dialogs that pop
up. I figured this must be the reason. There is one dialog asking about
whether or not to enable/disable macros. There is one suggesting I open
read-only unless I need to make changes and lastly there are few that
pop up a password box.

The password ones are no problem. I understand the failure.

But what about the others? I tried setting EnableEvents to false and
DisplayAlerts to false but this did not make a difference.

I am using the COM interface to Excel 2000. I have been able to
translate most VB examples to my C++ but it is possible the
DisplayAlerts is not quite correct. The DisplayAlerts property is an
array of VARIANT_BOOL. The PutDisplayAlerts method takes a long lcid and
a VARIANT_BOOL. I am guessing lcid is an index. Which indices should I
set? Right now I am just guessing at 0. The GetDisplayAlerts just
returns VARIANT_BOOL. Huh?

Is there documentation on these methods anywhere? I am using C++ but I
do have VS.NET so I should have access to VB for reference. VB is not an
option for the application as this is only a part of a much larger C++
application.

Basically what I want to do is open the file with no user interaction,
select all rows/columns and call autofit, change all background to white
text to black and that is it. I need as little user interaction as
possible, like zero if possible.


Any help appreciated
TIA

JO
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
How to: Open closed workbook/Search data tables/Return data to open workbook Hugh Adams Excel Discussion (Misc queries) 0 August 18th 10 02:04 PM
how do i open a data workbook when i open a timesheet workbook [email protected] uk Excel Discussion (Misc queries) 2 January 4th 09 04:50 PM
vlookup failure & ctrl-f failure? joemeshuggah Excel Discussion (Misc queries) 4 December 22nd 08 07:22 PM
failure to open up excel file Dr Alok Modi MD Excel Discussion (Misc queries) 3 June 17th 08 03:02 PM
after a power failure I can't open the spreadsheet mauricio Excel Discussion (Misc queries) 1 December 27th 05 09:27 PM


All times are GMT +1. The time now is 07:31 PM.

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"