runtime error 1004 method range of object '_global failed

I receive this error when i run this macro from Excel 2000 spanish
version, but no when i run in english version?

Public Function gf_CopyPasteData(s_range As String, s_range2 As String,
i_start_sheet_index As Integer, i_end_sheet_index As Integer) As
Integer
    'copies data from sheet one sheet to another sheet
    If CInt(Range(s_range).Count) = CInt(Range(s_range2).Count) Then
        Sheets(i_start_sheet_index).Select
        Range(s_range).Select
        Selection.Copy
        Sheets(i_end_sheet_index).Select
        Range(s_range2).Select
        ActiveSheet.Paste
        'validation passed, both ranges are of the same size
        gf_CopyPasteData = 0
    Else
        'validation failed, both ranges are a different size
        gf_CopyPasteData = 1
    End If
End Function
 
thanks

0
valdesd (4)
10/5/2005 8:30:11 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
912 Views

Similar Articles

[PageSpeed] 47

Where is this code?  Is it behind a worksheet module?

If it is, maybe fully qualifying each range would help.

But it really isn't really necessary to select objects to work with them:

Public Function gf_CopyPasteData(s_range As String, s_range2 As String, _
          i_start_sheet_index As Integer, i_end_sheet_index As Integer) _
               As Integer
    'copies data from sheet one sheet to another sheet
    If CInt(Range(s_range).Count) = CInt(Range(s_range2).Count) Then
        Sheets(i_start_sheet_index).Range(s_range).copy _
          destination:=Sheets(i_end_sheet_index).Range(s_range2)
        'validation passed, both ranges are of the same size
        gf_CopyPasteData = 0
    Else
        'validation failed, both ranges are a different size
        gf_CopyPasteData = 1
    End If
End Function

valdesd wrote:
> 
> I receive this error when i run this macro from Excel 2000 spanish
> version, but no when i run in english version?
> 
> Public Function gf_CopyPasteData(s_range As String, s_range2 As String,
> i_start_sheet_index As Integer, i_end_sheet_index As Integer) As
> Integer
>     'copies data from sheet one sheet to another sheet
>     If CInt(Range(s_range).Count) = CInt(Range(s_range2).Count) Then
>         Sheets(i_start_sheet_index).Select
>         Range(s_range).Select
>         Selection.Copy
>         Sheets(i_end_sheet_index).Select
>         Range(s_range2).Select
>         ActiveSheet.Paste
>         'validation passed, both ranges are of the same size
>         gf_CopyPasteData = 0
>     Else
>         'validation failed, both ranges are a different size
>         gf_CopyPasteData = 1
>     End If
> End Function
> 
> thanks

-- 

Dave Peterson
0
petersod (12004)
10/6/2005 12:18:52 AM
thanks Dave
i'm going to try and i let you Know

Thanks Again

0
valdesd (4)
10/6/2005 6:26:09 PM
Reply:

Similar Artilces:

Listbox Itemdata editable at runtime?
I have a listbox with data populated from a SQL Server 2000 database table. I have a subform that works like editbox for the record selected on the listbox. I am trying to make the listbox values be updated when data is changed and the record is updated from subform. I am doing this in the subform's afterupdate event: Private Sub Form_AfterUpdate() Me.Parent.lstORServiceLevelApprovals.ItemData(6, lIndex) = fieldvalue End Sub Here the lIndex is presaved listindex of the listbox in mainform and the fieldvalue is value of the bonded field value on subform same as column 6 of the l...

error on save
i am using publisher 2003 and when i try to save the project i am working on, i am getting an error "cannot create a temporary working file" anyone have any idea what or why this is? thanks. NEVER MIND - I FOUND A FIX FOR THIS. THANKS! "AL" wrote: > i am using publisher 2003 and when i try to save the project i am working on, > i am getting an error "cannot create a temporary working file" anyone have > any idea what or why this is? thanks. Have you looked to see *where* you're saving this file? -- JoAnn Paules MVP Microsoft [Publisher] ...

Creating ToolBar at runtime
hai I am Working in VC++ and I need to create Toolbars at Run Time but I have no Idea how to Start and where to look into could any one help me -praveen When you create a doc/view application using the wizard, it creates the code which creates a toolbar at run time. I am not sure if thats what you are asking. If you mean that you need to provide the bitmaps and button info at run time, you can do that as well. Take a look at CToolBar class. It has bunch of methods including setting all properties at run time, including image lists, button info etc. -- Ajay Kalra [MVP - VC++] ajaykalra...

protection error
I have a problem with protection tool in excel. I set protection to worksheet, but it had not applied to whole sheet. Some parts can still be editing. Why protection does not applied to whole worksheet? How can I fix it? Could you help me please? Thanks, The cells on the sheet that can still be edited are probably not "Locked". Select one of those cells and use Format --> Cells and go to the [Protection] tab. If the check box next to "Locked" is empty, it means that the cell may be edited even when the sheet is protected. "Selen" wrot...

"Edit List Items" on runtime?
I have some database forms in Access 2007 set up so that when I use a combo box control, a little button shows up at the bottom that says "Edit List Items." When I click this, it opens up the form behind the combo box and lets me add a new item. When I give this form to my coworker using the Access 2007 Runtime though, these Edit List Items buttons don't show up. Is there a way I can make them visible on the runtime? Or an alternative to let them add a new list item? Thanks, Joel ...

can i load bitmap in runtime in MFC?Thanks
I created a Picture control on a dialog and use CFileDialog to get the BMP filepath, then how to load the selected BMP to the Picture control? Thanks pcserver wrote: > I created a Picture control on a dialog > and use CFileDialog to get the BMP filepath, then how to load the selected > BMP to the Picture control? > > Thanks > > CStatic control is able to show bitmaps. Drop Picture control onto dialog and change its style to bitmap. And with LoadImage function you can load bitmap from file.... look for this article http://www.codeproject.com/bitmap/transbitma...

How do i select the coordinates of the first column & last row in a pasted range
This is a multi-part message in MIME format. ------=_NextPart_000_0023_01CA7DBE.CDD643B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable When i have a range pasted to a worksheet, how do i retrieve the = coordinates of the last row, first column of this range (the range = contains empty cells). Example of a range : B3:F32 =3D> the result shuld be B32 The range is not fixed, it could contain 1 row to ..... rows PS : The range is pasted and selected Thanx for your help. Luc ------=_NextPart_000_0023_01CA7DBE.CDD...

runtime error 1004 #2
I'm having this problem with this code when i try to run this in spanish version but no in english version: Public Function gf_CopyPasteData(s_range As String, s_range2 As String, i_start_sheet_index As Integer, i_end_sheet_index As Integer) As Integer 'copies data from sheet one sheet to another sheet If CInt(Range(s_range).Count) = CInt(Range(s_range2).Count) Then Sheets(i_start_sheet_index).Range(s_range).Copy _ Destination:=Sheets(i_end_sheet_index).Range(s_range2) 'validation passed, both ranges are of the same size gf_CopyPasteData =...

options error
Using XP Home - get ""Cannot access directory d:\My Documents" whenever I click on any tab in the Options dialogue box. So I cant change tanything including the default location of files. Also get an error message when Excel tries to autosave. I have removed and reinstalled Office, have installed SP1, started Excel from "Run"using "/safe" - but same happens. Have searched knowledgebase and found no hits for the Options issue, but found 1 for autosave - solution suggested is SP1. have seen 2 similar postings somewhere in this community which is wher I ...

OWA
When user attempts to log off they end up on a page: http://.../exchange/ggdimov/?Cmd=logoff but a message is displayed saying page cannot be displayed - HTTP 500 - Internal server error. How can that be fixed? We have only one exchange 2000 STD server SP3 on Windows 2000 Advanced Server with SP4 Thanks George MCP 318239 XCCC: "HTTP 500" Error Message Occurs When You Log Off or You Use http://support.microsoft.com/?id=318239 Thanks, Richard Roddy Microsoft Exchange Support This posting is provided "AS IS" with no warranties, and confers no rights. -------------------...

Error while opening spreadsheets
Whenever i open any excel spreadsheet, i get this error saying that "A Document with the name "name of the Spreadsheet" is already open. You can not open two documents with the same name, even if the documents are in defferent folders" Pls help me on this as i hv neither any document of the same name nor am i trying to open one. This might be it: http://www.contextures.com/xlfaqApp.html#AlreadyOpen (From Debra Dalgleish's site) "Bij." wrote: > > Whenever i open any excel spreadsheet, i get this error > saying that > "A Document with ...

DAO error
When I load certain programs (i.e. Roxio Creator 2009, a program to track diabetes data), I get a series of error messages: 1. "Please wait while Windows configures DAO" 2. A dialog box requesting a location to search for the file 3. "Error 1706. No valid source could be found for product DAO...." I ahve had MS Access 2005 installed; I also just installed MS Office 2010 (including Access). I got the message during both periods. The Roxio program seems to work OK without the fix, but it's annoying. How can I make it stop? Thanks a heap, -Zz WinXP...

GenerateAuthenticationHeader Error 401 Unauthorized in MSCRM 4.0
var lookupItem = new Array; lookupItem = crmForm.all.primarycontactid.DataValue; var sGUID=lookupItem[0].id; var Url ="http://" + document.domain + ":5555"; var serverUrl = Url + "/MSCrmServices/2007/CrmService.asmx"; var xml = "" + "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<soap:Envelope xmlnsoap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + GenerateAu...

2003 runtime and 2007 runtime on same PC
Hi all I currently have about 100 users using a FE/BE (SQL backend) with 2003 runtime. Another department now want a db and I would like to develop in 2007 and have them used 2007 runtime. Each department will only use their db but a couple of people (directors....) will need to be able to get into both. Will there be the "application install" delay with runtime? Can a pc have both runtime versions installed? Thanks for the help. -- Cheers On Wed, 24 Mar 2010 04:02:01 -0700, Cadburys <Cadburys@discussions.microsoft.com> wrote: An A2003 application r...

Socket Error WSAEPROVIDERFAILEDINIT
Hola a todo el mundo.... Mi problema es al crear un socket sobre w2k3, el valor de retorno es WSAEPROVIDERFAILEDINIT. El entorno en el que trabajo es el siguiente: Tengo un LSP registrado en la lista de catalogos de windows, los eventos que manejo son: lpProcTable->lpWSPConnect =3D WSPConnect; lpProcTable->lpWSPAccept =3D WSPAccept; Adem=E1s tengo un servicio que abre un puerto (0x0B50), pero al momento de crear el socket, este retorna WSAEPROVIDERFAILEDINIT, un fragmento del c=F3digo es. ..=2E ..=2E. wVersionRequested =3D MAKEWORD(2, 0); err =3D WSAStartup(wVersionRequested, &am...

Sales for Outlook error (long)
I have installed crm 1.2 using the iso images from my MSDN subscription. Server is set up and working on 2003 Server running SQL 2000, sp3 and hotfix MS03-31. Can access and use crm fine from any machines on the domain via IE, but can't get Sales for Outlook to work. The Sales for Outlook on a client machine installation goes fine, but when I open Outlook and click on the "Microsoft CRM" folder (or any subfolder) I get the pretty CRM error box (the one with the huge red X) that says, "An error has occurred. For more information, contact your system administrator." I...

fatal error LNK1104: cannot open file 'mfc71.lib'
I have a project that was built with VS 2003. After doing the auto conversion with VS 2005, I now get this error message when linking: fatal error LNK1104: cannot open file 'mfc71.lib' There is only one .cpp file in this project. There is no reference to MFC71.lib in the project. Any ideas? > I have a project that was built with VS 2003. After doing the auto > conversion with VS 2005, I now get this error message when linking: > > fatal error LNK1104: cannot open file 'mfc71.lib' > > There is only one .cpp file in this project. There is no reference to &g...

Intelligent Message Filtering
I recently installed SP2 on my Exchange 2003 servers. IMF was not installed previously. Now that SP2 is installed I'm trying to configure the SCL ratings. However, when I make any changes and then click Apply I get the following error: The requested operation did not satisfy one or more constraints associated with the class of the object. Facility: LDAP Provider ID no: 80072014 Microsoft Intelligent Message Filter Any ideas? That error comes from Active Directory. That error typically indicates access rights poblem. Was SP2 installed by yourself under the same credentials y...

vlookup error #4
i have this formula =IF(ISNA(VLOOKUP(A2,'\\Malcolmp\shared\My Documents\[Share Recommendations.xls]Portfolio'!$A$6:$J$67,10,FALSE)),"""", VLOOKUP(A2,'\\Malcolmp\shared\My Documents\[Share Recommendations.xls]'Portfolio'!$A$6:$J$67,10,FALSE)) i cant see what is wrong with it but i get an error based on \\Malcolmp\shared\My in the 2nd line much appreciated if anyone can help for some reason i dont get the error if i have the filepath pointing to a document on my hard drive rather than elsewhere onthe server. "Micayla Bergen" wrote: > i...

Access 2007 Runtime on Machine With Older Version?
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many do not, and it's not clear when they would get it. His thought was to use the upcoming Access 2007 runtime to allow the users who are still running Office 2003 to be able to run the database. While I use multiple versions of Access on my development machine, I advised him against this, as I recall from years ago with the Access 97 runtime that it caused problems when run on a machine that...

Outlook 2003 Errors sending emails
I am getting error message when sending emails. This happans since I have installed the new outlook 2003. I am getting the following error message: The following recipient(s) could not be reached: 'pdegeus@mns.com' on 22-Dec-03 9:44 PM 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) Any idea what this is Maybe check spelling MSN instead of MNS? "pdegeus@msn.com" <anonymous@discussions.microsoft.com> wrote in message news:<056901c3c8ff$d83455b0$a101280a@phx.gbl>... > I am getting error message when sending emai...

Search Form runtime error 2448
I am attempting to make a filter by form search for a issues/comment database that I created. I copied a form and VB template, switching out the names for what are being used in my database, but keep receiving a runtime error. It seems common from what I've read looking for answers, but everything that I've found suggested I've tried and does not seem to be the problem. The debug error is found at Me.Browse_All_Issues.Form.Filter = strWhere. Someone please help! Private Sub Search_Click() Const cInvalidDateError As String = "You have entered an invalid date...

upgrade to 2007 gets MAPI32.dll error
I have a user who upgraded her office 2003 to 2007(educational version) but since, whenever she tries to start outlook she gets an error 'cannot start microsoft outlook... mapi32.dll is missing or corrupt' She said she did try reinstalling and she did run the fixmapi program. Anything else?? thanks CR Just delete the mapi32.dll it will regenerate on its own "CRNews" wrote: > I have a user who upgraded her office 2003 to 2007(educational version) > but since, whenever she tries to start > outlook she gets an error 'cannot start microsoft outlook......

Refreshing Data from .txt file causes change outside data range
I have a simple Worksheet developed to import and format a single record .txt file, which will ulitmately be imported into an Access table. I have to do it this way (I think) because I don't get field names in the .txt file The first row contains Field Names, and the second row is the data range to be refreshed from the .txt. file When I refresh the data by selecting the range and chosing Data -> Refresh Data, the values are imported correctly, but my heading row is wiped out (except for the very first cell (A1). What can be causing this In addition, I will need to automate this comp...

Combine two ranges with different numbers of rows and columns
Hi, I have two different ranges with different numbers of rows and columns. I have to combine in a single range each row from the first range with each row from the second range. I provide hereunder an example. Any idea? Thank you! Range 1 A B C D E F G H I J K L Range 2 1 2 3 4 5 6 7 8 Result A B C 1 2 3 4 A B C 5 6 7 8 D E F 1 2 3 4 D E F 5 6 7 8 G H I ...