Problem with marko "Run time error 424 Object required".

JanQT 1 Reputation point
2022-06-07T14:15:12.377+00:00

0

Good morning,

At the beggining I want to say, that I am completely new in VBA. In my company we are trying to update old Excel file (2002) into 2016 ones. There are some problems with Macros wich worked perfectly on 2002 version.

In this Macro excel usd to past data from file in format ".rap" into specific cell. Now when trying to do that this Error accure:

Run time error 424 Object required

With specific line of code selected. Maybe someone can help me with that:

Private Sub Wklej_I_Wypelnij()

Dim Pozycja As Integer
Dim tekst As String
Dim numer As Integer
Dim Data As String
Dim FoundFlag As Boolean
Dim Data_Raportu As String
Dim Nazwa_Aplikacji As String
Dim Sciezka_Aplikacji As String
Dim Numer_Tekstu As Integer
Dim bajty As Long
Dim wskaznik As Long
Dim PoprzedniWskaznik As Integer

Data_Raportu = Date - 1
Pozycja = 0
Zmienne_We = Array(472, 473, 475, 476, 495, 496, 497, 510, 511, 512) 'Raport węglowodorów
Zmienne2_We = Array(109, 145) 'Raport urządzeń
Zmienne_Wy = Array(2, 4, 5, 7)

miesiace = Array("Styczeń", "Luty", "Marzec", "Kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień")

Nazwa_Aplikacji = ActiveWorkbook.Name

With objFileSearch

.FileType = "XRD2E*.rap"
.LookIn = "\\192.168.3.42\rap" 
.Execute
Microsoft 365 and Office Excel For business Windows
Developer technologies Visual Basic for Applications
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.