Excel 2007 Beta 2 problem moving worksheets via VBA macro

C

Chris Smith

I'm seeing a very specific issue running an Excel 2003 macro under Excel
2007 Beta 2, where the "ActiveSheet" object doesn't seem to work correctly
after programmatically opening a CSV file, e.g. with:

Workbooks.Open Filename:=this_file
ActiveSheet.Name = sheetname
ActiveSheet.Move Before:=DataBook.Sheets(LastTable)
LastTable = ActiveSheet.Name

I get run-time error 1004 (object-defined error) on the "Move" statement.
I've tried it on multiple 2007 systems, and it fails in the same way - on
the same systems running 2003 it works fine. On 2007, after getting the
exception, I can just hit Resume and the move is performed correctly - so it
looks like maybe a race condition of some kind?

Is there any way for non-techbeta users of beta 2 to file technical bug
reports? I'm on the Vista techbeta but not Office... and I can't see any
feedback mechanism for Office 2007 Beta 2. If there is a way to submit
private bug reports with tracking, I'd be happy to provide the entire macro
and a sample data file to make it very easy to repro the problem...

If anyone can suggest a workaround I could try in the meantime to get the
script working again that would be very helpful also!


Thanks in advance,

Chris.
 
G

gavin.ayling

Chris said:
I'm seeing a very specific issue running an Excel 2003 macro under Excel
2007 Beta 2, where the "ActiveSheet" object doesn't seem to work correctly
after programmatically opening a CSV file, e.g. with:

Workbooks.Open Filename:=this_file
ActiveSheet.Name = sheetname
ActiveSheet.Move Before:=DataBook.Sheets(LastTable)
LastTable = ActiveSheet.Name

I get run-time error 1004 (object-defined error) on the "Move" statement.
I've tried it on multiple 2007 systems, and it fails in the same way - on
the same systems running 2003 it works fine. On 2007, after getting the
exception, I can just hit Resume and the move is performed correctly - so it
looks like maybe a race condition of some kind?

Is there any way for non-techbeta users of beta 2 to file technical bug
reports? I'm on the Vista techbeta but not Office... and I can't see any
feedback mechanism for Office 2007 Beta 2. If there is a way to submit
private bug reports with tracking, I'd be happy to provide the entire macro
and a sample data file to make it very easy to repro the problem...

If anyone can suggest a workaround I could try in the meantime to get the
script working again that would be very helpful also!


Thanks in advance,

Chris.

There's a smiley face programme that allows you to send a screenshot
and a comment about why a feature is good or bad -- but I don't think
that's tracked.
 
P

Patrick Smith [MSFT]

Chris,

Can you post more of your code so that I can simply copy and paste to try a
repro? Or could you post your files in this thread?

thanks,
Patrick Smith
Program Manager
Office Programmability
 
C

Chris Smith

Any news on this one Patrick???

Chris.

Patrick Smith said:
Chris,

Can you post more of your code so that I can simply copy and paste to try
a repro? Or could you post your files in this thread?

thanks,
Patrick Smith
Program Manager
Office Programmability
 
Top