You are here:

Excel/.formula does not work in french setting

Advertisement


Question
Hi Aidan,

I have tried to find the solution to this problem for 2 days now and hope you can help me.
I am "importing" data from one workbook to another using the following code. it works very well on an english computer, but falls on a french computer. (I have created a mini macro just to recreate that problem and could send you the workbooks)
the part that does not work on the french computer is .formula
I understand that it would not work if the formula contained Excel function such as SUM etc as it would have to be written in french (SOMME), but in this particular case the formula involves only the path, the name of the file, the sheet and the range.
it would be great if you could help me.
thanks a lot. as usual your help is greatly appreciated.
Caroline

Sub DataImport1()
Application.ScreenUpdating = False
 MsgBox ("import1")
   
         Dim myworkbook As String
         myworkbook = ThisWorkbook.Path & "\" & Range("WorkbookNameCell").Value
         
         'check workbook exists
         If FileFolderExists(myworkbook) Then
         'copy data
         Dim mydata As String
         mydata = "='" & ThisWorkbook.Path & "\" & "[" & Range("WorkbookNameCell").Value & "]sheet1'!Export1"

         With Range("Export1")
         .Formula = mydata
         .Value = .Value
         End With
         Else
         
         MsgBox (" The file " & Range("WorkbookNameCell").Value & " does not exist!")
         Exit Sub
         End If

End Sub

Answer
VBA should be fine because it's always written in english regardless of the language - I WONDER if the error trapper is giving you a false indication of where the error is though because you are using FileFolderExists which isn't native to excel so MAY be the cause of the error?

I am of course probably wrong (!) and I'm more than happy to look at a file to see if I can spot anything else that may be the cause of the problem- email being aidan.heritage@virgin.net
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Aidan Heritage

Expertise

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards. I'm based in the UK, so please allow for time differences when asking me questions from other parts of the world!

Experience

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

Education/Credentials
I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2016 About.com. All rights reserved.