Solved

VB.net Excel Add-in ID not saving when file re-opened

Posted on 2014-03-27
2
266 Views
Last Modified: 2014-04-02
Hi

I am using the following code to set the ID of a cell
Globals.ThisAddIn.Application.Cells(1, 2).ID = "Test"

I use msgbox(Globals.ThisAddIn.Application.Cells(1, 2).ID) to make sure that
the ID is written to the cell

Then when I manually save , close and re-open the file the ID is empty

Is this a VB.net bug? If I use standard Excel VBA it saves the ID fime
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
andrewssd3 earned 500 total points
ID: 39960803
Using Application.Cells(1, 2).ID will point you to the active workbook, so it's possible you are not saving the ID to the place you are expecting.  Better would be to get a proper reference to the workbook/worksheet you are interested in then using the Cells method for that worksheet to do your setting.  Obviously I don't know what you are doing so I can't give you the code for this, but if you need help with that, let me know.

Also the documentation (here) says that the ID is saved when the workbook is saved as a webpage.  I haven't used this property before - might it be lost if you save as a normal workbook?

Stuart
0
 

Author Closing Comment

by:Murray Brown
ID: 39972951
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question