|
-
Feb 4th, 2007, 04:56 PM
#3
Re: [2005] Location problems. Urgent.
First of all, you absolutely can NOT do this:for the very reaosn that the error message says. The Location property returns a value, i.e. a copy of the value stored in the Panel. If you set the X property of that copy then the original is completely unaffected, so even trying is pointless. The compiler will not allow you to set a property of a property directly when the parent property is a value type for that reason. You would have to set the Panel's Left property, which is what its for. Alternatively you can assign the value of the Location property to a variable, set its X property and then assign the variable back to the Location property.
As for your import issue, I would guess that you are introducing a name clash with your import, i.e. there are two namespaces, types or members with the same name and the IDE is interpreting what you enter as the opposite of what you intend. The norm is to import Office namespaces with an alias:
VB Code:
Imports Excel = Microsoft.Office.Interop.Excel
That means that anywhere you want to refer to the Microsoft.Office.Interop.Excel namespace you type Excel. It means that you don't type as much as you would without the import but there'll be no name clashes as all types within that namespace must be qualified.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|