View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
SeanC UK[_2_] SeanC UK[_2_] is offline
external usenet poster
 
Posts: 63
Default Workbooks.Open oddity

Hi,

Try using:

Workbooks.Open Filename:="Page1.xml" Local:=True

There is a difference in how VBA tries to open or save workbooks to the way
in which Excel does it. Local = False, as is default, uses the VBA language
and setting Local to True uses control panel settings. This might be the
issue, so try this and see if it works.

Good luck,

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"minimaster" wrote:

I'm struggeling to understand this.

I need to work with some data columns from a xml file. The columns do
contain numbers with a comma as decimal seperator. Same as in the
control panel settings.

Sub OpenXML()
Workbooks.Open Filename:="PAGE1.xml"
End Sub

When I start this procedure with Macros... run or directly in the VBE
it runs fine, the file is opened and all numbers are recognized as
numbers in Excel.

When I start the macro via a commandbarbutton from one of my add-ins
with commandbars the numbers are not recognized correctly and all
numbers are strings.

I've tried to start the macro via Excel.Application.Run "openXML" but
that didn't help either. (though I didn't believe it would make a
difference, but just in case)

Can anybody explain this?