Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VSTO 2008 ambiguous name

Posted on 2008-10-27
5
Medium Priority
?
247 Views
Last Modified: 2013-11-10
Hi
I am getting an error on the following line of code "Globals is ambiguous, imported from the namespaces or types AOG2.Microsoft.Visual Basic.

xlApp.ActiveWorkbook.Styles.Merge(Workbook:=xlApp.Workbooks(Globals.ThisWorkbook.Name))
0
Comment
Question by:Murray Brown
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 22821639
What kind of project is this and what references do you have set?
Regards,
Rory
0
 

Author Comment

by:Murray Brown
ID: 22821810
Hi

Its a managed spreadsheet project. I had moved it from a computer with VS 2008 and Office 2003 to a machine with Office 2007
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 2000 total points
ID: 22821854
The message means that the keyword "Globals" could refer to more than one class or namespace.  It sounds like you have an Imports statement for the Microsoft.VisualBasic namespace.  If you remove that Imports statement, it should fix your Globals reference.  If you are using functions from the MS.VisualBasic namespace, you would have to fully qualify them in your code.

Example, instead of calling "Instr" you would have to call Microsoft.VisualBasic.Instr
0
 

Author Closing Comment

by:Murray Brown
ID: 31510250
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

876 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