Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Workbooks.Add = Macro Regression in 2007

Hi,

It seems that the "Workbooks.Add" method has regressed from 2003 to 2007
when using "HTM" file. Here is the "one line macro" that demonstrates the
same. (The attached HTML open fine from "File/Open" menu or using
the API 'Workbook.Open')


'... Macro Start
Workbooks.Add "c:\temp\abc.htm"
'... Macro End

If I used the 'abc.htm' file (not sure how to attach to this post - hence
typing below) then XL 2007 throws up.

///////////// ABC.HTM//////////////////
<html<body<center
<h1VectorPRO<supĀ®</sup</h1
<h2Support Resource Priority Report</h2
<table width="90%" border=1
<tr
<td style='color:white;border:.5pt solid
black;background:#4F81BD;'Support Resource</td
<td style='color:white;border:.5pt solid black;background:#4F81BD;' </td
<td style='color:white;border:.5pt solid
black;background:#4F81BD;'Expected Start</td
<td style='color:white;border:.5pt solid
black;background:#4F81BD;'Actual Start</td
<td width="20" style='font-size:7.0pt;color:white;border:.5pt solid
black;background:#4F81BD;'Clr</td
<td style='color:white;border:.5pt solid black;background:#4F81BD;'Task
Manager</td
<td style='color:white;border:.5pt solid black;background:#4F81BD;'Task
Name </td
</tr
<tr
<tdUjjwal Ghosh(Jr)</td
<tdPressure testing of tuyers</td
<td6/16/2007 09:00 AM</td
<td6/16/2007 09:00 AM</td
<td width="20" style='font-size:7.0pt;background:#99CC00;' </td
<tdN ADHIKARY</td
<tdOVERHAULING OF DRILL MACHINE</td
</tr
</table
</center</body</html

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Workbooks.Add = Macro Regression in 2007

Should you be using the Open method, instead of Add? (This works for me
with Excel 2000.)

Workbooks.Open "c:\temp\abc.htm"
--
Regards,
Bill Renaud


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Workbooks.Add = Macro Regression in 2007

Thanks Bill.

I did discover that by recording macro in 2007. But the question is more
deep rooted (sorry for being terse in my previous post).

I know there is no written commitment by MS to ensure that macros will
behave the same, but atleast they should not regress. Because now I am not
sure which macros will work and which will fail (for the features that have
not changed).

As I continue my journey I found that now the Sheet.Delete macro throws up
and message box (ok / cancel) which was not there earlier.

This is good news for development community because they will continue to
earn and survive with each new release of MS products. But as a consumer, it
puts question mark on ROI's of investments which many times go beyond few
years.

Any way, its different usless debate (as I doubt if MS reads this and doubt
more if they fix this).

Thanks for your answer.
----------------------------------------------------------
"Bill Renaud" wrote:

Should you be using the Open method, instead of Add? (This works for me
with Excel 2000.)

Workbooks.Open "c:\temp\abc.htm"
--
Regards,
Bill Renaud



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Workbooks.Add = Macro Regression in 2007

The Workbooks.Add method was always intended to add a new, blank Excel
workbook to the workbooks collection. Any parameter that was included as
an argument was to specify a template (Chart, Excel 4 Macro sheet, or
worksheet).

Abhijit wrote:
<<As I continue my journey I found that now the Sheet.Delete macro
throws up a message box (ok / cancel) which was not there earlier.

I (still) use Excel 2000, and you always had to turn DisplayAlerts off
before deleting any sheets, otherwise the prompt would appear:

Application.DisplayAlerts = False
Worksheets("Data").Delete
Application.DisplayAlerts = True

So in Excel 2007, is there some new layer of security on top of this?
--
Regards,
Bill Renaud



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
I want to use the regression tool in office excel 2007... Rika_8503 Excel Discussion (Misc queries) 1 February 15th 09 09:17 PM
Excel 2007; graph the best fit line from a regression analysis? mattz Charts and Charting in Excel 1 October 7th 08 11:28 PM
how to: polynomial regression trendline excel 2007 miltstep Charts and Charting in Excel 1 June 23rd 08 05:06 PM
Problem with Regression function in 2007, Analysis Tool Pak Lauren273 Excel Discussion (Misc queries) 2 May 25th 08 10:00 PM
regression analysis in excel 2007? nassema Excel Discussion (Misc queries) 1 January 29th 07 01:23 PM


All times are GMT +1. The time now is 09:50 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"