Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cells not updating after data populated into spreadsheet using ADO

Hi.

I have a spreadsheet which has one worksheet (Analysis) where the rows in
one column reference the rows on a second worksheet using a simple worksheet
reference notation, for example:
='Retail Price List'!A1

I use ADO.NET (using ASP.NET / C#) to populate the values of the 'Retail
Price List' worksheet and when I do so, the values from the 'Retail Price
List' worksheet show up correctly on the 'Analysis' worksheet.

However if I add a custom ribbon to the excel document, the ='Retail Price
List'!A1 type references no longer reflect the data on the 'Retail Price
List' worksheet. Instead it shows '0' in the cell that contains the ='Retail
Price List'!A1 reference, even though the A1 cell on the Retail Price List
worksheet contains a value. If I edit the cell that contains the ='Retail
Price List'!A1 reference (i.e. hit F2 and then Enter without making any
changes), the value shows up.

The only difference between this working correctly or not is that it stops
working correctly after I add a custom ribbon using the Office Custom UI
Editor tool.

I am using Excel 2007. The excel file format is .xlsm.
In C# I use the 'Microsoft.ACE.OLEDB.12.0' ADO.NET driver for Excel.

Does anyone have an idea for why the cell references are not correctly
reflected?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Cells not updating after data populated into spreadsheet using ADO

I have had this issue for years when importing data from Oracle into XL using
ADO (even before 2007 and the CustomUI tool). It's like the formats are not
updated when the data is written into the sheet.

You can get around/fix this by setting your code to run the following after
an update:

ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value

This is the equivalent to pressing "F2" and enter at each cell only it does
the whole sheet at once. It's annoying, but the above fix is quick enough.

Hope this helps.


"Base64" wrote:

Hi.

I have a spreadsheet which has one worksheet (Analysis) where the rows in
one column reference the rows on a second worksheet using a simple worksheet
reference notation, for example:
='Retail Price List'!A1

I use ADO.NET (using ASP.NET / C#) to populate the values of the 'Retail
Price List' worksheet and when I do so, the values from the 'Retail Price
List' worksheet show up correctly on the 'Analysis' worksheet.

However if I add a custom ribbon to the excel document, the ='Retail Price
List'!A1 type references no longer reflect the data on the 'Retail Price
List' worksheet. Instead it shows '0' in the cell that contains the ='Retail
Price List'!A1 reference, even though the A1 cell on the Retail Price List
worksheet contains a value. If I edit the cell that contains the ='Retail
Price List'!A1 reference (i.e. hit F2 and then Enter without making any
changes), the value shows up.

The only difference between this working correctly or not is that it stops
working correctly after I add a custom ribbon using the Office Custom UI
Editor tool.

I am using Excel 2007. The excel file format is .xlsm.
In C# I use the 'Microsoft.ACE.OLEDB.12.0' ADO.NET driver for Excel.

Does anyone have an idea for why the cell references are not correctly
reflected?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cells not updating after data populated into spreadsheet using

Thanks for the suggestion. It works well in the sense that it does update the
cell contents.

I agree it is annoying to have to do this though, it would seem Excel should
do an automatic refresh of all cells when the workbook is opened.

Perhaps it is the ADO.NET drivers that are broken for certain file formats.
The same workbook works fine when the template is populated in .xls format,
it exhibits problems only in the .xlsx, .xlsb and .xlsm formats...

Thanks

"xp" wrote:

I have had this issue for years when importing data from Oracle into XL using
ADO (even before 2007 and the CustomUI tool). It's like the formats are not
updated when the data is written into the sheet.

You can get around/fix this by setting your code to run the following after
an update:

ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value

This is the equivalent to pressing "F2" and enter at each cell only it does
the whole sheet at once. It's annoying, but the above fix is quick enough.

Hope this helps.


"Base64" wrote:

Hi.

I have a spreadsheet which has one worksheet (Analysis) where the rows in
one column reference the rows on a second worksheet using a simple worksheet
reference notation, for example:
='Retail Price List'!A1

I use ADO.NET (using ASP.NET / C#) to populate the values of the 'Retail
Price List' worksheet and when I do so, the values from the 'Retail Price
List' worksheet show up correctly on the 'Analysis' worksheet.

However if I add a custom ribbon to the excel document, the ='Retail Price
List'!A1 type references no longer reflect the data on the 'Retail Price
List' worksheet. Instead it shows '0' in the cell that contains the ='Retail
Price List'!A1 reference, even though the A1 cell on the Retail Price List
worksheet contains a value. If I edit the cell that contains the ='Retail
Price List'!A1 reference (i.e. hit F2 and then Enter without making any
changes), the value shows up.

The only difference between this working correctly or not is that it stops
working correctly after I add a custom ribbon using the Office Custom UI
Editor tool.

I am using Excel 2007. The excel file format is .xlsm.
In C# I use the 'Microsoft.ACE.OLEDB.12.0' ADO.NET driver for Excel.

Does anyone have an idea for why the cell references are not correctly
reflected?

Thanks

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
Custom Form for updating data in an existing spreadsheet Xhawk57 Excel Discussion (Misc queries) 2 November 12th 08 04:45 PM
Automatically updating data from another excel spreadsheet Gary c Excel Worksheet Functions 1 November 20th 05 02:41 PM
Updating data into one spreadsheet from another Rick Excel Discussion (Misc queries) 1 September 24th 05 11:26 PM
External SQL Data not updating in spreadsheet when loading in OWC Chris Tromans Excel Programming 0 May 18th 05 06:16 PM
how do populate empty cells with the contents of populated cells . Jim99 Excel Discussion (Misc queries) 6 April 21st 05 05:44 PM


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