VBA RE: Compile error, can't find project library

gg

Well-known Member
Joined
Nov 18, 2003
Messages
560
Hey folks!! It has been a while for me to visit...
Last year I designed the below code to automate some task.
The code has worked like a dream. However, we are getting to point where we need some new PC's. I tried to run this same code and got a compile error, can't find project library.

This error occurs on this line
If myNAMC = "TMMK-VEH" Then
NAMC = 4



Public Sub SKPIUPDATE()
Dim QPR
Dim lnk
Dim frm
Dim start
Dim fin
Dim drp1
Dim drp2
Dim src1
Dim NAMC As Integer
' This macro will automatically open and download the TMMK-VEH daily scrap
'and store the file in the same directory

Set QPR = CreateObject("InternetExplorer.application")

QPR.Visible = True

QPR.navigate "https://www.portal.toyotasupplier.com/wps/myportal/"

Do While QPR.Busy: DoEvents: Loop
Do While QPR.readyState <> 4: DoEvents: Loop

With QPR.document.forms("Login")
.User.Value = "xxxxx"
.Password.Value = "xxxxx"
.submit
End With

Application.Wait Now + TimeSerial(0, 0, 11)

QPR.navigate ("https://www.portal.toyotasupplier.com/skpi/")

Application.Wait Now + TimeSerial(0, 1, 30)

If myNAMC = "TMMK-VEH" Then
NAMC = 4
ElseIf myNAMC = "TMMK-PWT" Then
NAMC = 3
ElseIf myNAMC = "TMMC" Then
NAMC = 5
ElseIf myNAMC = "TMMTX" Then
NAMC = 6
ElseIf myNAMC = "TABC" Then
NAMC = 7
ElseIf myNAMC = "NUMMI" Then
NAMC = 8
ElseIf myNAMC = "TMMI" Then
NAMC = 9
ElseIf myNAMC = "TMMTX" Then
NAMC = 6
ElseIf myNAMC = "TMMBC" Then
NAMC = 10
ElseIf myNAMC = "TMMAL" Then
NAMC = 11
ElseIf myNAMC = "TMMNK" Then
NAMC = 12
End If

Set lnk = QPR.document.Links(3) ' 3=TMMK-VEH,4=TMMK-PWT,5=TMMC,6=TMMTX,7=TABC,8=NUMMI,9=TMMI,10=TMMBC,11=TMMAL,12=TMMNK

lnk.Click

Do While QPR.Busy: DoEvents: Loop
Do While QPR.readyState <> 4: DoEvents: Loop

QPR.navigate ("https://www.portal.toyotasupplier.com/skpi/SkpiGatewayServlet?jadeAction=NCPARTS_SEARCH")

Do While QPR.Busy: DoEvents: Loop
Do While QPR.readyState <> 4: DoEvents: Loop

Set frm = QPR.document.forms("form1")
Set dwn = QPR.document.forms("page")

Set start = frm.all("SKPI_SEARCH_START_DATE_KEY")
start.Value = "01/01/2007"

Set finish = frm.all("SKPI_SEARCH_END_DATE_KEY")
finish.Value = "12/31/2007"

Set drp2 = frm.all("SKPI_SEARCH_NC_TYPE_KEY")
drp2.Item(1).Selected = True

Set src1 = frm.all("Submit")

src1.Click

Do While QPR.Busy: DoEvents: Loop
Do While QPR.readyState <> 4: DoEvents: Loop

QPR.navigate ("https://www.portal.toyotasupplier.com/skpi/DownloadNCPartListServlet")

Application.Wait Now + TimeSerial(0, 1, 0)

Windows("DownloadNCPartListServlet").Activate

ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\ggodwin\My Documents\_DENSO QRE\SKPI Parts return\" & Range("C2").Value & ".xls"
ActiveWorkbook.Close

QPR.navigate ("https://www.portal.toyotasupplier.com/public/pr_logout.htm")

Windows("SKPI 2007.xls").WindowState = xlMaximized
End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
The first thing you should do is take a look under Tools>References... in the VBE.

Look for anything marked MISSING and uncheck it.
 
Upvote 0
Yep,
I had some kind of an Outlook thingy missing....
lets see what else can occurr...

thank you
 
Upvote 0
Is there a way to fix this permanately? It appears that each time I re-open Excel. I am required to perform this step?
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top