Public Sub Auto_Open()in
End
.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
.CommandBars("Status Bar").Visible = False
With Application
.CommandBars("Formating")
.Visible = False - not
in this version
.DisplayFormulaBar = False
.DisplayScrollBars = False
.Caption = " "
.ActiveWindow.Caption = ""
.ActiveWindow
.DisplayHeadings = False
.ActiveWindow.DisplayWorkbookTabs = False
.ActiveWindow.DisplayVerticalScrollBar = False - also possible
.ActiveWindow.DisplayHorizontalScrollBar = False - also possible
.WindowState = xlNormal
End With
make some sheets
invisible, such as:
Security Warning -
Automatic update of
links has been disabled
For Each theBar In
Application.CommandBars
Call readMailTXT(get_mailArrOfRQSku, get_subjSKUtoBeSetUpQuant)
Call SetupBestBuy
Call Notification_Email(get_arr_of_set_up_SKU, PIMId,
get_arr_of_UPC, ArrMarketDataHeaders, MarketingMatrix)
Call Save_Exit
On Error Resume Next
theBar.Enabled = False
Next
End For Each
Public Sub Auto_Close()
End
.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
.CommandBars("Status Bar").Visible = True
.CommandBars("Formating").Visible = True - not in this version
.DisplayFormulaBar = True
.DisplayScrollBars = True
.ActiveWindow.DisplayHeadings = True
.ActiveWindow.DisplayWorkbookTabs = True
.ActiveWindow.DisplayVerticalScrollBar = True - also possible
.ActiveWindow.DisplayHorizontalScrollBar = True - also possible
.Caption = Empty
.ActiveWindow.Caption = False
.WindowState = xlNormal
With Application
End With
make other sheets visibe
again; such as: Security
Warning - Automatic
update of links
has been disabled
For Each theBar In
Application.CommandBars
On Error Resume Next
theBar.Enabled = True
Next
End For Each
Public Sub Save_Exit()
End
Application.DisplayAlerts
= False
PL_OPEN = True ?
Application.Workbooks(C_myMacroFile).Activate
Application.Workbooks(C_myMacroFile).Save
Application.Quit
Application.Workbooks
(filePL).Close
SaveChanges:=False
Yes
No
Public Function
GetOpenIEByURL(ByVal
pop_up_URL As String) As
SHDocVw.InternetExplorer
End
VBA MACRO - TOOLS - REFERENCES - BROWSE - go to WINDOWSSYSTEM32shdocvw.dll
(will add MICROSOFT INTERNET CONTROL - TICK THIS OPTION)
Function uses the SHDocVw.ShellWindows object to iterate the running IE instances
ignore errors when accessing the document property
On Error Resume Next
Loop over all
Shell-Windows
For Each GetOpenIEByURL
In objShellWindows
If the document is of
type HTMLDocument,
it is an IE window
TypeName(GetOpenIEByURL
.Document) =
"HTMLDocument" ?
Debug.Print
TypeName(GetOpenIEByURL
.Document)
check the URL
GetOpenIEByURL.Document
.URL = pop_up_URL ?
leave, we found
the right window
Next
End For Each
Yes
No
Yes
No
Private Function
GetXLCol(ByVal Col As
Integer) As String
End
ASCII value For capital A
Col is the present column, not the number of cols
THIS ALGORITHM ONLY WORKS UP TO ZZ. It fails on AAA
Col > 701 ?
Col <= 25 ?
GetXLCol = ""
GetXLCol = sCol
sCol = Chr(A + Col)
iRemain = Int((Col / 26)) - 1
sCol = Chr(A + iRemain) & GetXLCol(Col Mod 26)
Yes
No
Yes
No
Sub readMailTXT
(mailArrOfRQSku,
subjSKUtoBeSetUpQuant)
End
, subjSKUtoBeSetUpQuant
As Byte
Open plocha2 & "" &
soubor_na_plose For
Input Access Read As #1
Not EOF(1) ?
subjLength = LOF(1)
Close #1
subjSKUtoBeSetUpQuant = 0
Input #1, mailSubject
----00000 until
the 4th position,
For subjCharNo = 4 To
(subjLength - 5)
the dash is not relevant
is_num = False
not_num = False
std_chr = False
not_std = False
Mid(mailSubject,
subjCharNo, 1) = "-" ?
ASCII code for numerical
characters must follow
For krok = 1 To 5 Step 1
SKU char to the left
must be alphanumeric,
lower case will
be capitalized
t = Asc(Mid(mailSubject,
subjCharNo + krok, 1))
(48 <= t And t <= 57) ?
is_num = True
not_num = True
Next krok
For krok = 1 To 3 Step 1
not_num = False And
Not_std = False ?
t = Asc(UCase(Mid
(mailSubject, subjCharNo
- 4 + krok, 1)))
(48 <= t And t <= 57) Or
(65 <= t And t <= 90) ?
std_chr = True not_std = True
Next krok
ReDim Preserve
mailArrOfRQSku
(subjSKUtoBeSetUpQuant)
SKU is nine digits long
mailArrOfRQSku(subjSKUtoBeSetUpQuant) = UCase(Mid(mailSubject, (subjCharNo - 3), 9))
subjSKUtoBeSetUpQuant = subjSKUtoBeSetUpQuant + 1
Debug.Print Mid(mailSubject, (subjCharNo - 3), 9)
Debug.Print mailArrOfRQSku(subjSKUtoBeSetUpQuant - 1)
Next subjCharNo
Yes
No
End For
Yes
No
End For
Yes
No
End For
Yes
No
Yes No
Sub Notification_Email
(ByVal get_arr_of_set_up_
SKU, ByVal PIMId, ByVal
get_arr_of_UPC, ByVal
ArrMarketDataHeaders,
ByVal MarketingMatrix)
End
works in Office 2000-2007
p = 0
Application.DisplayAlerts = False
this error subscript out
of range in the field
get_arr_of_set_up_SKU
will occur when we are
not logged in to
corporate network, thus
opening of Price List
will return this error
On Error GoTo Chyby2
and then we run this
procedure with arrays
that have no dimensions,
thus this procedure
would return another
error -> finish
makro -> RAS
Set OL_App = CreateObject("Outlook.Application")
OL_App.Session.Logon
Set OL_Mail = OL_App.CreateItem(0)
message = False
SetUpQuant <> 0 And
done_1 = True ?
signature = "Regards," & vbNewLine & vbNewLine & "Ales
Vymyslicky (Accenture)" & vbNewLine & "E&D NAOC Transaction
Team" & vbNewLine & "tel: + 420 225 042 496" &
vbNewLine & "e-mail: v-alvymy@microsoft.com"
On Error Resume Next
mailBody_part1 = "Hello
everyone," & vbNewLine &
vbNewLine & "Please be
inFormed that the "
UBound(get_arr_
of_set_up_SKU) < 1 ?
mailSubject = ""
mailBody_part3 = ""
mailBody_part2 = "item
below has been set up on
the PIM portal:" &
vbNewLine & vbNewLine
mailBody_part2 = "items
below have been set up
on the PIM portal:" &
vbNewLine & vbNewLine
For m = 0 To
UBound(get_arr_of_
set_up_SKU)
message = True
mailSubject = mailSubject & get_arr_of_set_up_SKU(m) & " ; "
mailBody_partX = "This is the PIM Id# " & PIMId(m) & vbNewLine & "This is the UPC# " &
get_arr_of_UPC(m) & vbNewLine & "This is the SKU# "
& get_arr_of_set_up_SKU(m) & vbNewLine & vbNewLine
mailBody_part3 = mailBody_part3 & mailBody_partX
For n = 0 To
UBound(ArrMarketDataHeaders)
ArrMarketDataHeaders(n)
= "1st Image" Or
ArrMarketDataHeaders(n)
= "2nd Image" ?
ReDim Preserve photographs(p)
photographs(p) = MarketingMatrix(m, n)
p = p + 1
Next n
Next m
done_2 = True ?
nic z toho nemohlo
byt naset-upovano
mailBody_part1 = zprava
& vbNewLine & vbNewLine
(neni na PL), mohou nastat pripady: vse bylo
udelano, nic nebylo udelano, neco z toho
bylo udelano, neco bylo udelano a zbytek neni
na PL, do budoucna pripad bylo udelano drive
message = True
message = True ?
On Error GoTo 0
Set OL_Mail = Nothing
Set OL_App = Nothing
"skuaoc@winse
.microsoft.com"
With OL_Mail
.SentOnBehalfOfName = "v-alvymy@microsoft.com"
.To = "v-annahe@microsoft.com; v-ivoten@microsoft.com"
.CC = "skuaoc@winse.microsoft.com"
.BCC = ""
.Subject = "SKU set-up notification for the " & mailSubject
.Body = mailBody_part1 & mailBody_part2 & mailBody_part3 & signature
For p = 0 To
UBound(photographs)
or use .Send
straight away
.Attachments.Add
(photographs(p))
Next p
.Display
End With
Chyby2: Application
.DisplayAlerts = False
Application.Quit
Yes
No
Yes
No
End For
End For
Yes
No
Yes
No
Yes
No
End For
Private Sub
is_busy(ByVal internet)
End
.Busy ?
With internet
.ReadyState <> 4 ? DoEvents
End With DoEvents
Application.Wait (Now +
TimeValue("0:00:3"))
Yes
No
Yes
No
Sub pvtus_SQL_dotaz(tier,
layer, ByVal current_SKU)
End
Set objRecordset = CreateObject("ADODB.Recordset")
PartN = "'" & current_SKU & "'"
objConnection.Open "Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=True;Initial
Catalog=AdHocReporting;Data Source=Homedepot;Use Procedure For Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=OM761600;Use Encryption For
Data=False;Tag With column collation when possible=False"
strSQL = "SELECT EndItemPallet.EndItemPalletID, EndItemPallet.EndItemOperationsViewID,
EndItemPallet.PalletSizeCodeID, EndItemPallet.PalletQuantity, EndItemPallet.PalletTie,
EndItemPallet.PalletLayers, EndItemOperationsView.EndItemOperationsViewID,
EndItemOperationsView.MaterialID,
Material.MaterialID, Material.PartNumber FROM
AdHocReporting.dbo.EndItemOperationsView EndItemOperationsView,
AdHocReporting.dbo.EndItemPallet EndItemPallet,
AdHocReporting.dbo.Material Material WHERE (Material.MaterialID
= EndItemOperationsView.MaterialID) AND (EndItemPallet.EndItemOperationsViewID =
EndItemOperationsView.EndItemOperationsViewID) AND (EndItemPallet.PalletSizeCodeID=1204) AND
(Material.PartNumber=" & PartN & ")"
objRecordset.Open strSQL, objConnection
tier = objRecordset.Fields.Item("PalletTie").Value
layer = objRecordset.Fields.Item("PalletLayers").Value
pom = objRecordset.Fields
.Item("PartNumber").Value
Sub SetupBestBuy()
End
SetUpQuant udava SKUtoBeSetUpQuant - notSetUpQuant(realna-co je na PL)
SetUpQuant udava pri Dimenzovani MatrixPLfltrd index radku vcetne zahlavi
bude nacitat ruzne cis Formaty, aby se pak dodrzely
pro ucely Formula row, kde pridava Excel
ve slove Fry's jeste jeden quote na vic
input field
input field
login button PLtab = "Price
List Report"
Application.OnTime Now + TimeValue("00:30:00"), "Save_Exit" 'autotermination
If error and no response in 30 mins Then autotermination, however problem With
multiple set-ups - how long period? For 6 SKUs, maybe 3 hours. For 1 Sku, 30 min
Saving to Best Buy database via portal is extremely slow -> 1 set-up takes 25 min
reseni: cas, za ktery nastane autoterminace by se mohl menit = SetUpQuant * 30 min
MyDate contains the current system date.
MyDate = Date
MyDay = Day(MyDate)
MyMonth = Month(MyDate)
MyYear = Year(MyDate)
YY = MyYear Mod 100
YY = "0" & YY
MyMonth < 10 ?
MyDay >= 15 ?
MM = "0" & MyMonth MM = MyMonth
***** Tracking down the latest pathPL and
actual filePL name *** (or the 2nd latest)**
***** IT Connection Manager must be connected
via RAS Card !!! *******************
DD = "15" DD = "01"
On Error GoTo Chyby
pathPL = pathPL_C1 & MM & DD & YY & pathPL_C2
typeselection = "*.xls"
the first listed filePL
will be loaded into the
filePL string variable
otherwise an Empty string
filePL = Dir(pathPL &
typeselection,
vbReadOnly)
searching For the
substring, returns
0 If not found
filePLSubstringIND =
InStr(1, filePL,
C_SubString)
alternatively, to be
more specific: If
filePLSubstringIND
= 14 Then
filePLSubstringIND <> 0 ?
Workbooks.Open
Filename:=pathPL & "" &
filePL, ReadOnly:=True
PL_OPEN = True
On Error GoTo PLnotReady
account name starts
always on the 14th
character so
it could be: Do
filePLSubstringIND = 0 ?
filePLSubstringIND
<> 14 ?
read the Next filePL in
the directory If there
is none Then an Empty
string will be assigned
filePL = Dir()
filePLSubstringIND = InStr(1, filePL, C_SubString)
filePLSubstringIND <> 0 ?
PLnotReady: ***** Tracking down the 2nd latest PL pathPL and its
name If filePLSubstringIND = 0 ***************
***** from now on it will continue With opening
the PL belonging to the previous period
Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True
PL_OPEN = True
filePLSubstringIND = 0 ?
If PL is not Ready
***** How many arrays are there on the PL? + Loading the headers
into an array + Searching For the PartNumber
Response = MsgBox("The
pathPL " & pathPL & "
does not exist, has been
changed, or the latest
PL has not been issued
yet. Would you like to
try to open the older
one?", vbYesNo
+ vbCritical)
If NO - GOTO chyby, PL
neni dostupny, see
Else na radku 106
Response = vbYes ?
***** start reading the
PL from the preceding
period *****
MyDay >= 15 ?
DD = "01"
pathPL = pathPL_C1 & MM & DD & YY & pathPL_C2
typeselection = "*.xls"
the first listed filePL
will be loaded into the
filePL string variable
otherwise an Empty string
filePL = Dir(pathPL & typeselection, vbReadOnly)
filePLSubstringIND = InStr(1, filePL, C_SubString)
filePLSubstringIND <> 0 ?
Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True
PL_OPEN = True
On Error GoTo Chyby
filePLSubstringIND = 0 ?
filePL = Dir()
filePLSubstringIND = InStr(1, filePL, C_SubString)
filePLSubstringIND <> 0 ?
Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True
PL_OPEN = True
DD = "15"
MyMonth <= 10 ?
pathPL = pathPL_C1 & MM & DD & YY & pathPL_C2
typeselection = "*.xls"
MyMonth = 1 ?
MM = "12"
YY = (MyYear Mod 100) - 1
YY = "0" & YY
MyMonth = MyMonth - 1
MM = "0" & MyMonth
MyMonth = MyMonth - 1
MM = MyMonth
the first listed filePL
will be loaded into the
filePL string variable
otherwise an Empty string
filePL = Dir(pathPL & typeselection, vbReadOnly)
filePLSubstringIND = InStr(1, filePL, C_SubString)
filePLSubstringIND <> 0 ?
Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True
PL_OPEN = True
On Error GoTo Chyby
account name starts
always on the
14th character
filePLSubstringIND = 0 ?
read the Next filePL in
the directory If there
is none Then an Empty
string will be assigned
filePL = Dir()
filePLSubstringIND = InStr(1, filePL, C_SubString)
filePLSubstringIND <> 0 ?
Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True
PL_OPEN = True
***** Else
response is vbNo
Header *******
Application.ScreenUpdating = False
!!! nutno aktivovat
spravny tab !!!
Workbooks(filePL).Sheets(PLtab).Activate
Range("A1").Select
Header = ActiveCell.FormulaR1C1
ColQuant = 0
Header <> Empty ?
MID is a text Function and it returns a specific number of characters from a text
string, starting at the position you specify, based on the number of characters you specify
ActiveCell.Address returns the address in $F$1 Format, so we need the position 2
***** Refreshing the "Is the SKU on the PL? " CELLS - Column B ******************
***** according to the latest MM DD YY Tiger's PL *********************************
ColQuant = ColQuant + 1
ColNo = ActiveCell.Column
ReDim Preserve ArrHeaders(ColQuant - 1)
ArrHeaders(ColQuant - 1) = Header
ReDim Preserve ArrVirtualColumnLetters(ColQuant - 1)
ColNo < 27 ?
ArrVirtualColumnLetters
(ColQuant -
1) = ColLetter
ColLetter =
Mid(ActiveCell.Address,
2, 1)
Header = C_MSSKU ?
SKUColLetter = Mid(ActiveCell.Address, 2, 1)
ColNoSku = ColNo
teoreticky pro $AA$1
ColLetter =
Mid(ActiveCell.Address,
2, 2)
Header = C_MSSKU ?
SKUColLetter = Mid(ActiveCell.Address, 2, 1)
ColNoSku = ColNo
virtual - slupec nemusi
existovat, pocet
se muze menit
ActiveCell.Offset(0, 1).Select
Header = ActiveCell.FormulaR1C1
Windows(C_myMacroFile).Activate
Sheets(C_myMacroSheet).Range("A2:B12").Select
Selection.ClearContents
Qfile = MM & DD & YY & FDQuote
Const FDQuote =
"_MS_PC_Fry''s.xls" 'pro
ucely Formula row -
specifically for FRYS
containing quote
PLtab = "Price
List Report"
assigning quote
uv = "'"
Range("A1").Select
For increment = 0 To
get_subjSKUtoBeSetUpQuant
- 1
Range("A2").Select
increment = 2
writing input SKUs from
emailSKUinputSKUsBEPC
.txt to worksheetu
ActiveCell.Offset
(increment + 1, 0).Value
= get_mailArrOfRQSku
(increment)
Next increment
konvertuje byte na
string automatickym
prirazenim
incstring = increment
RQSkuCELL = "A" & incstring
SKUtoBeSetUp = ActiveCell.FormulaR1C1
osetreni chyb lze vynechat, v pripade chyby
vraci vlookup do bunky #N/A , t.j. nenalezl
On Error Resume Next
Err.Clear
SKUtoBeSetUpQuant = 0
SKUtoBeSetUp <> Empty ?
***** End of refreshing *********************************************************
***** Records refreshing in line With the inputted SKUs *************************
***** Printing headers **********************************************************
?there is one extra
value in the array, we
wont need it, it is an
address of the
last empty cell
ReDim Preserve ArrOfRQSkuCELL(SKUtoBeSetUpQuant)
ArrOfRQSkuCELL(SKUtoBeSetUpQuant) = RQSkuCELL
ReDim Preserve ArrOfRQSku(SKUtoBeSetUpQuant)
ArrOfRQSku(SKUtoBeSetUpQuant) = SKUtoBeSetUp
increment = increment + 1
cellTEXT = "=If(iserror(vlookup(" & RQSkuCELL & "," & uv & "[" & Qfile & "]" & PLtab & uv & "!$" &
SKUColLetter & ":$" & SKUColLetter & ", 1, False)), 0, 1)"
ActiveCell.Offset(0, 1).Value = cellTEXT
ReDim Preserve ArrOfPLind(SKUtoBeSetUpQuant)
ActiveCell.Offset(0,
1).Value = 1 ?
SKUtoBeSetUpQuant = SKUtoBeSetUpQuant + 1
incstring = increment
RQSkuCELL = "A" & incstring
ArrOfPLind
(SKUtoBeSetUpQuant)
= True
ArrOfPLind
(SKUtoBeSetUpQuant)
= False
If Err.Number = 0 Then
MsgBox "The SKU has been found on the current Fry's PL"
Else
MsgBox "The SKU is not on the current Fry's PL"
(jinak pro vsechny ostatni chyby by mohl zobrazit tento MsgBox)
End If
ActiveCell.Offset(1, 0).Select
SKUtoBeSetUp = ActiveCell.FormulaR1C1
For i = 1 To
ColQuant Step
1
***** Clearing cells
*************************
*******************
****************
Range("A15").Select
ActiveCell.Offset(0, i - 1).Value = ArrHeaders(i - 1)
Next i
Sheets(C_myMacroSheet).Range("A16:AC26").Select
Selection.ClearContents
***** Loading
SKUtoBeSetup one by one:
Do While SKUtoBeSetUp <>
Empty ***********
Range("A2").Select
SKUtoBeSetUp = ActiveCell.FormulaR1C1
zajistime filtrovani az
od druheho radku
SKU sloupce
SkuColRange1 =
SKUColLetter & "2"
w = 0
y = 0
notSetUpQuant = 0
nacita z input array dokud nenarazi na Empty cell
rowVirtual = 1
SKUtoBeSetUp <> Empty ?
Chyby:
nelzeulozit:
»3 »4
** 1 **
** 2 **
Yes No
Yes No
Yes
No
Yes No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
End For
Yes
No
Yes
No
End For
Yes No
***** loading cells that
might be used into a
matrix a zkouska
tisku **************
SetUpQuant = SKUtoBeSetUpQuant - notSetUpQuant
SetUpRowFltrd = 0
Windows(C_myMacroFile).Activate
Sheets(C_myMacroSheet).Select
Range("a15").Select
napr 0 az SetUpQuant, 0
az 28 = 29 sloupcu
ReDim MatrixPLfltrd
(SetUpQuant,
ColQuant - 1)
For i = 0 To
w
from now on we shall
only print the matrix
just to test
values and Formates
ActiveCell <> Empty ?
Do While ActiveCell = Empty 'preskoci prazdne bunky
ActiveCell.Offset(1, 0).Select
Loop
For j = 0 To ColQuant - 1
SetUpRowFltrd = SetUpRowFltrd + 1
ActiveCell.Offset(1, -ColQuant).Select
!!!
value!!!
MatrixPLfltrd
(SetUpRowFltrd, j)
= ActiveCell.Value
vezme vyslednou hodnotu vzorce a ne
vzorec v dane bunce a ulozi hodnotu do
MatrixPLfltrd, to je rozdil od ActiveCell.Formula[R1C1]
ActiveCell.Offset(0,
1).Select
Next j
ActiveCell.Offset(1,
0).Select
Next i
Range("a29").Select
tisk bez zahlavi
-> od 1 ne od 0
For i = 1 To SetUpQuant
Workbooks(filePL).Close False - pokud zavru
PL tak indirect bude ukazovat ihned REF
OPEN MARKETING & TECHNICAL DATA SHEET
*********************************************
For j = 0 To ColQuant - 1
ActiveCell.Offset(1,
-ColQuant).Select
Select Case
MatrixPLfltrd(0, j)
ActiveCell.Value = MatrixPLfltrd(i, j)
ActiveCell.Offset(0, 1).Select
C_MSD ?
C_DateDiscontinued ?
Selection.NumberFormat
= "mm/dd/yy"
C_StartEffectiveDate ?
Selection.NumberFormat
= "mm/dd/yy"
C_EndEffectiveDate ?
Selection.NumberFormat
= "mm/dd/yy"
C_UPC ?
Selection.NumberFormat
= "mm/dd/yy"
C_MPQ ?
Selection.NumberFormat
= "0"
C_PalletQuantity ?
Selection.NumberFormat
= "0"
C_NetPrice ?
Selection.NumberFormat
= "0"
C_MSRP ?
Selection.NumberFormat
= "0.00"
C_Un_Weight ?
Selection.NumberFormat
= "0.00"
C_Un_Length ?
Selection.NumberFormat
= "0.00"
C_Un_Width ?
Selection.NumberFormat
= "0.00"
C_Un_Depth ?
Selection.NumberFormat
= "0.00"
C_MP_Weight ?
Selection.NumberFormat
= "0.00"
C_MP_Length ?
Selection.NumberFormat
= "0.00"
C_MP_Width ?
Selection.NumberFormat
= "0.00"
C_MP_Depth ?
Selection.NumberFormat
= "0.00"
Else
Selection.NumberFormat
= "0.00"
Selection.NumberFormat
= "GENERAL"
Next j
Next i
On Error GoTo Chyby
vyhledame z marketingove
databaze jen ta SKU,
ktera jsou na PL
Workbooks.Open
Filename:=plocha & "" &
C_myMarketData,
ReadOnly:=True
!!! nutno aktivovat
spravny tab !!!
Workbooks(C_myMarketData).Sheets("Sheet1").Activate
Range("A1").Select
MarketDataHeader = ActiveCell.FormulaR1C1
MarketDataColQuant = 0
MarketDataHeader
<> Empty ?
ReDim MarketingMatrix
(SetUpQuant - 1,
MarketDataColQuant - 1)
MarketDataColQuant = MarketDataColQuant + 1
ReDim Preserve ArrMarketDataHeaders(MarketDataColQuant - 1)
ArrMarketDataHeaders(MarketDataColQuant - 1) = MarketDataHeader
ActiveCell.Offset(0, 1).Select
MarketDataHeader = ActiveCell.FormulaR1C1
For i = 1 To SetUpQuant
Application.DisplayAlerts = False
Application.Workbooks(C_myMarketData).Close SaveChanges:=False
current_SKU = MatrixPLfltrd(i, ColNoSku - 1)
k = 0
ArrMarketDataHeaders(k)
<> C_PartNumber ?
ArrMarketDataHeaders(k)
= C_PartNumber ?
k = k + 1
Range(SKUColLetter
& "1").Activate
SKUColLetter =
GetXLCol(ByVal k)
ted vyhledame to current_SKU jestli v te databazi je (melo by byt, kdyz je na PL),
a jestli vsechny atributy jsou vyplnene to nebudeme zjistovat - databazi je nutno
aktualizovat kazdych 14 dni - Pokud databaze nebude aktualni (SKU nenalezeno), pak
cyklus pobezi do posledniho radku Excelu a nastane chyba -> makro se ukonci, coz je
dobre, aby nesetupoval pak v kategoriich nesmysly !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Muzem vypsat hlaseni, ze databaze atributu neni aktualni. !!!!!!!!!!!!!!!!!!dodelat
done = False
current_SKU <>
ActiveCell.FormulaR1C1
And done = False ?
ActiveCell.Offset(1,
0).Select
current_SKU =
ActiveCell.FormulaR1C1 ?
R = ActiveCell.Row
Range("A" & R).Activate
For jj = 0 To
MarketDataColQuant - 1
done = True
MarketingMatrix(i - 1,
jj) = ActiveCell
.Offset(0, jj).Value
Next jj
Next i
kontrolni bajt, ze minimalne 1 SKU bylo nasetupovano
*********************** CYKLUS - SKU SETUP **************************************
*** pro vsechna SKU -> i = 1 To SetUpQuant **************************************
done_1 = False
kontrolni bajt rika, ze
alespon 1 SKU
bylo submitovano
done_2 = False
kontrolni bajt rika, ze
jsme se presvedcili o
pravdivosti If
SetUpQuant <> 0 Then
done_3 = False
a ze nenastala chyba On
Error GoTo nelzeulozit
Set IE = Nothing
On Error GoTo nelzeulozit
SetUpQuant <> 0 ?
Application
.ScreenUpdating = True
nebereme v uvahu prvni
radek MatrixPLfltrd -
zahlavi; vyuzijeme
pro prehlednost
For i = 1 To SetUpQuant
or Call is_busy(IE)
ArrHeaders
If ArrOfPLind(i
- 1) = True Then
IE Is Nothing ?
IE.Busy And Not
IE.ReadyState = 4 ?
Set IE =
CreateObject
("InternetExplorer
.Application")
.Left = 50
.Top = 50
.Height = 800
.Width = 1000
.MenuBar = 0
.Toolbar = 1
.StatusBar = 0
.navigate C_PIMPORTAL_LOGIN
With IE
wait a while until IE
has finished to load
Call is_busy(IE)
OR eq:
Do While IE.busy And Not IE.readystate = 4 : DoEvents : Loop
.Visible = 1
End With
login - enter ID,
pass and click OK
.getElementById(C_element_userID).Value = C_myID
.getElementById(C_element_password).Value = C_myPW
.getElementById(C_element_PC_7_0_64__login).Click
With IE.Document
End With
Call is_busy(IE)
click on Item induction
RUN the JAVASCRIPT Function from Within VBA
(Function PC_7_0_IS_openURL in the HTML)
DoEvents
IE.Document.all.Item
Call IE.Document.parentWindow.execScript
("javascript:PC_7_0_IS_openURL('Item Induction')",
"JavaScript")
Call is_busy(IE)
Excell VBA Calls the Javascript Function openItemNew
Complete Non Data Pool Item - should be New -
an mistake in HTML - does not effect anything
IE.Document.all.Item
Call IE.Document.parentWindow.execScript("javascript:openItemNew('Complete
Non Data Pool Item')",
"JavaScript")
Call is_busy(IE)
Wait and fill in the Form
******** SELECT CATEGORY AND GENERAL
TAB *******************************
IE.Document.all.Item("PC_7_0_J3_Category").Click
Call is_busy(IE)
pop_up_URL =
"https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml
/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h3DgDJgFjGpvqRqCKOcAFf
j_zcVP0gfW_9AP2C3NCIckdHRQDCtOS9/delta/base64xml
/L0lJWWtpQ1NZL0lGakFBQVRBQUNKQUFNekNxcUEhLzRJVUdSWVFxTkhwQ0d3ZyE
vNl8wX0NULzdfMF9MVS82XzBfQ1A!?CATALOG_NAME=Trade Item
Catalog&ATTR_NAME=&KEY_CATEGORY_SELECTION=YES&KEY_ITEM_ID=null&KEY_GPC_CATEGORY=&KEY_COLLAB_ID=Item
Induction&WF_ITEM=True"
funkce v deklaracni
casti vraci
Set pop_up =
GetOpenIEByURL
(pop_up_URL)
objekt ze sbirky oken shellu
* V matici musim zjistit cisla sloupcu tech poli podle kterych budu zarazovat do kategorii
v kazdem pripade je mandatorni ColNoItemName a ColNoBusUnit,
v pripade ColNoDivName, ColNoProType, ColNoLegalName je potreba tyto
promenne take inicializovat, protoze nebudou soucasti pole Headeru
ArrHeaders na Xbox ceniku, jinak by byla chyba pri testovani.
I kdyz nebudeme napr. ColNoDivName potrebovat pri otevrenem Xbox ceniku,
musime nastavit tuto promennou napr. na 1 a bude pak odkazovat na
PriceListName = "UNITED STATES BEST BUY USD FPP" sloupec, takze vysledek
jakehokoliv testovani na nejaky substring bude stejne 0.
ColNoDivName = 1
ColNoProType = 1
ColNoLegalName = 1
For j = 0 To
(ColQuant -
1)
* determinace kategorie na bazi
ItemName, BusUnit, DivName, ProType
Predpoklad, ze kategorie je PC_SW_non_VG
Select Case ArrHeaders(j)
C_ItemName ?
C_LegalName ?
ColNoItemName = j + 1
C_BusUnit ?
ColNoLegalName = j + 1
C_DivName ?
ColNoBusUnit = j + 1
C_ProType ?
ColNoDivName = j + 1
ColNoProType = j + 1
Next j
kategorie =
"PC_SW_non-VG"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoItemName -
1)), "ZUNE") <> 0 ?
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoItemName -
1)), "XBOX") <> 0 ?
kategorie = "Zune"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit - 1)),
"ACCESSORIES") <> 0 ?
sluzi jen k
upresneni buyera
kategorie =
"Zune_Accessories"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit - 1)),
"WINDOWS GAMING") <> 0 ?
kategorie = "Accessories"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit - 1)),
"CONSOLE") <> 0 ?
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit - 1)),
"PARTY") <> 0 ?
kategorie =
"XBOX_Console"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit - 1)),
"XNA 360") <> 0 ?
kategorie = "XBOX_SW"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit -
1)), "LIVE") <> 0 ?
kategorie = "XBOX_SW"
If InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "CNTRL") <> 0 Or InStr(1,
UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "CONTROLLER")
<> 0 Or InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName
- 1)), "CONTROLLR") <> 0 Or InStr(1, UCase(MatrixPLfltrd(i,
ColNoItemName - 1)), "CNTRLR") <> 0 Or InStr(1,
UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "WHEEL") <>
0 Or InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)),
"GAMING DEVICES") <> 0 Then
kategorie = "Input_Devices-Game_Controller"
kategorie = "Accessories"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoDivName - 1)), "SDA
HARDWARE") <> 0 ?
kategorie = "VG_PC_SW"
Select Case kategorie
kategorie = "PC_Hardware"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit - 1)),
"MOUSE") <> 0 ?
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit - 1)),
"KEYBOARD") <> 0 ?
kategorie =
"Input_Devices-Mice"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoBusUnit -
1)), "ICE") <> 0 ?
kategorie =
"Input_Devices-Keyboards"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoLegalName -
1)), "MOUSE") <> 0 ?
kategorie = "Web Cams"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoLegalName - 1)),
"KEYBOARD") <> 0 ?
kategorie =
"Input_Devices-Mice"
InStr(1,
UCase(MatrixPLfltrd(i,
ColNoLegalName - 1)),
"NOTEBOOK") <> 0 ?
kategorie slouzi jen k
upresneni buyera
kategorie =
"Input_Devices
-Notebook_Mice"
kategorie =
"Input_Devices-Keyboards"
j = 0
"Input_Devices-Game_
Controller" ?
"Input_Devices-Keyboards"
?
super_html_kategorie = " Computer and
Video Game Control and Input Devices"
html_kategorie = " Game Controllers"
"Input_Devices-Mice" ?
super_html_kategorie = " Computer and
Video Game Control and Input Devices"
html_kategorie = " Keyboards"
"Input_Devices
-Notebook_Mice" ?
super_html_kategorie = " Computer and
Video Game Control and Input Devices"
html_kategorie = " Mice and Trackballs"
"Accessories" ?
super_html_kategorie = " Computer and
Video Game Control and Input Devices"
html_kategorie = " Mice and Trackballs"
"Web Cams" ?
super_html_kategorie = " Computer and Video Game Peripherals"
html_kategorie = " Video Game Accessory"
"PC_SW_non-VG" ?
super_html_kategorie = " Computer and Video Game Peripherals"
html_kategorie = " Web Cameras"
"VG_PC_SW" ?
super_html_kategorie = " Computer and Video Game Software"
html_kategorie = " Software Non-Games"
"XBOX_SW" ?
super_html_kategorie = " Computer and Video Game Software"
html_kategorie = " Video Game Computer Software"
"XBOX_Console" ?
super_html_kategorie = " Computer and Video Game Software"
html_kategorie = " Video Game Software"
"Zune" ?
super_html_kategorie = " Video Game Consoles"
html_kategorie = " Video Game Hardware - Non Portable"
"Zune_Accessories" ?
super_html_kategorie = " Video Game Consoles"
html_kategorie = " Video Game Hardware - Portable"
super_html_kategorie = " Video Game Consoles"
html_kategorie = " Video Game Hardware - Portable"
Call is_busy(pop_up)
pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(2).Click
Call is_busy(pop_up)
pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(4).Click
Call is_busy(pop_up)
pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(2).Click
Call is_busy(pop_up)
pop_up.Document.all.tags
("a")(j).innerTEXT <>
super_html_kategorie ?
pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(j
- 1).Click
Call is_busy(pop_up)
jj = 0
j = j + 1
pop_up.Document.all.tags
("a")(jj).innerTEXT <>
html_kategorie ?
pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(jj).Click
Call is_busy(pop_up)
pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(j - 1).Click
jj = jj + 1
*** EXIT POP-UP
With saving: ****
Call is_busy(pop_up)
pop_up.Document.all.Item
("600000017///800000079")
.Click 'item name
differs depending on how
the category
tree is expanded
pop_up.Document.getElementsByTagName("Form")
(0).getElementsByTagName("input")(9).Click
Call is_busy(IE)
Set pop_up = Nothing
For j = 0 To ColQuant - 1
With IE.Document
IE.Busy And Not
IE.ReadyState = 4 ?
Application.Wait (Now + TimeValue("0:00:3"))
IE.Document.all.Item
Call IE.Document.parentWindow.execScript("javascript:PC_7_0_IS_openURL('Item
Induction')", "JavaScript")
Call is_busy(IE)
IE.Document.all.Item("PC_7_0_J1_WORKFLOW_SELECT").Click
Call is_busy(IE)
IE.navigate
"https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml
/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h39gLJgFjGpvqRqCKOcAFf
j_zcVP0gfW_9AP2C3NCIckdHRQAl6aCR/delta/base64xml
/L0lDU0lKQ1RPN29na21DU1Evb0tvUUFBSVFnakZJQUFRaENFSVFqR0VKemdBIS8
DoEvents
0 SkZpQ28wZWgxaWNvblFWR2h
kLXNJZDJFQSEhLzdfMF9KMS8y
NzIvc2EuU1RFUE5BTUU!?PC_
7_0_J1_STEPNAME=Complete
%20Non%20Data%2
0 Pool%20Item&PC_7_0_J1_COLLABAREA_ID=Item%20Induction&PC_
7_0_J1_WORKFLOW_ID=Item%20Induction%20Workflow%20v1#7_0
_J1"
Call is_busy(IE)
Application.Wait (Now + TimeValue("0:00:3"))
For i = 0 To
SetUpQuant -
1
Call is_busy(IE) equival
j = 0
IE.Document.all.tags
("td")(j).innerTEXT
<> PIMId(i) ?
IE.Busy And Not
IE.ReadyState = 4 ?
j = j + 1
IE.Document.all.tags
("td")(j).innerTEXT
= PIMId(i) ?
IE.Document
.getElementsByTagName
("td")(j -
1).getElementsByTagName
("input")(0).Checked
= True
DoEvents Next i
IE.Busy And Not
IE.ReadyState = 4 ?
done_2 = True
DoEvents LOG OUT
IE.navigate
"https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml
/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h39gLJgFjGpvqRqCKOcAFf
j_zcVP0goESkOVDEy1A_Kic1PTG5Uj9Y31s_QL8gNzSi3NvREQD-ps-
S/delta/base64xml/L0lKSklKSWchL0lCakFBR3lBQkVRaUlBISEvNElENnhCX1dFTkRDLzEwOTUvMTM3NzIvbG8!"
zavrit browser
IE.Quit znicit objekt
Set IE = Nothing
je-li SetUpQuant = 0 nevytvori se ani instance internet exploreru
none of them
zprava = "The requested
SKU/SKUs is/are not on
the BestBuy PC PL"
kontrola, ze nenastala
chyba logovani do IE,
ale SetUpQuant
je opravdu 0
done_3 = True
pri cteni souboru muze
teoreticky nastat
nasledujici
«1
»8 »7
** 4 **
** 5 **
** 6 **
End For
Yes
No
End For
End For
End For
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
End For
Yes No
Yes
No
Yes
No
Yes
No
End For
Yes
No
End For
Yes
No
Yes
No
End For
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
No
End For
Yes
No
End For
Yes
No
Yes
No
Yes
No
Yes
No
Workbooks(filePL).Sheets
(PLtab).Activate
vybere napriklad bunku F2
Range(SkuColRange1).Select
SKU = ActiveCell.FormulaR1C1
(SKU <> SKUtoBeSetUp)
And (SKU <> Empty) ?
pokud nalezne tak vyfiltruje cely radek z PL do makro workbooku
ale ne pomoci copy paste, nybrz jako odkaz z workbooku na PL,
tim ze vlozi nejaky dynamicky utvareny string zacinajici rovnitkem
ActiveCell.Offset(1, 0).Select
SKU = ActiveCell.FormulaR1C1
SKU = SKUtoBeSetUp ?
R = ActiveCell.Row
nebudeme kopirovat cely aktivni radek najednou z PL do workbooku
Range(R & ":" & R).Copy
ale zaplnime workbook postupne odkazy na PL bunky
Windows(C_myMacroFile).Activate
w = w + 1
Sheets(C_myMacroSheet).Range("A15").Select
ActiveCell.Offset(w, 0).Select
myCellAdd = ArrOfRQSkuCELL(w - 1)
For pozice = 1 To
ColQuant Step 1
Range("A2").Select
y = y + 1
ActiveCell.Offset(y, 0).Select
SKUtoBeSetUp = ActiveCell.FormulaR1C1
ColNo = ActiveCell.Column
Header = ArrHeaders(pozice - 1)
jestlize je "Date" v
headeru pak
Format bude datum
InStr(1, Header,
"Date") <> 0 ?
pozice < 27 ?
Selection.NumberFormat
= "mm/dd/yy"
InStr(1, Header,
C_UPC) <> 0 ?
Selection.NumberFormat
= "0"
need to be Formated as
general (not
specified), otherwise
Selection.NumberFormat = "GENERAL"
Formulae End up as text
ColNo >= ColNoSku ?
ColLetter =
Mid(ActiveCell.Address,
2, 1)
pro pripad $F$1 a nize
budeme operovat s
promennou SKUColLetter,
tj pismeno sloupce
teoreticky pro $AA$1
ColLetter =
Mid(ActiveCell.Address,
2, 2)
ActiveCell.Offset(0,
1).Select
ColNo = ColNoSku ?
myCellAdd =
SKUColLetter & "$" & R
SKUColLetter = ColLetter
vlookupPAR3 = ColNo - ColNoSku + 1
cellTEXT = "=vlookup(" & myCellAdd & "," & uv & "[" & Qfile & "]" & PLtab & uv & "!" &
SKUColLetter & ":" & ColLetter & "," & vlookupPAR3 & ",0)"
ActiveCell.Value = cellTEXT
Duv = Chr$(34)
cellTEXT = "=INDIRECT(CONCATENATE(" & Duv & uv & "[" & Qfile & "]" & PLtab & uv & "!" & Duv &
", ADDRESS(MATCH(" & myCellAdd & "," & uv & "[" &
Qfile & "]" & PLtab & uv & "!" & SKUColLetter & ":" &
SKUColLetter & ",0), MATCH(" & Duv & Header & Duv & ","
& uv & "[" & Qfile & "]" & PLtab & uv & "!$A$1:$" &
ArrVirtualColumnLetters(ColQuant - 1) & "$1,0))))"
ActiveCell.Value = cellTEXT
Next pozice
Windows(C_myMacroFile).Activate
Range("A2").Select
y = y + 1
ActiveCell.Offset(y, 0).Select
SKUtoBeSetUp = ActiveCell.FormulaR1C1
!!!
w = w + 1
notSetUpQuant = notSetUpQuant + 1
«2
** 3 **
Yes No
Yes
No
End For
Yes
No
Yes
No
Yes
No
Yes No
Yes
No
Select Case kategorie
Warranty decision block
***********************
"Input_Devices-Game_
Controller" ?
"Input_Devices-Keyboards"
?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Kristi Baso"
"Input_Devices-Mice" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Kristi Baso"
"Web Cams" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Kristi Baso"
"Input_Devices
-Notebook_Mice" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Kristi Baso"
"Accessories" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Katie Penza"
"XBOX_Console" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "David Arndt"
"PC_SW_non-VG" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "David Arndt"
"VG_PC_SW" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Huan Nguyen"
"XBOX_SW" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Ed Hewitt"
"Zune" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Jenna Susko"
"Zune_Accessories" ?
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value
= "Tom Kluis"
.getElementById("_
215127057_0_426000597_0_
351613033_0").Value =
"Charles Murray"
.getElementById("_
215127057_0_263500921_0_
318388927_0")
.selectedIndex = 2
InStr(1, kategorie,
"SW") <> 0 ?
** Sample Sent
days
Warranty Labour Days/Years
.getElementById("_
215127057_0_263500921_0_
1935191691_0").Value = 90
days
Warranty Parts Days/Years
.getElementById("_
215127057_0_263500921_0_
434903867_0").Value = 90
years
.getElementById("_
215127057_0_263500921_0_
158089848_0").Value = 3
years
.getElementById("_
215127057_0_263500921_0_
577627864_0").Value = 3
.all.Item("_215127057_0_
224502806_0_1599375785_
0").selectedIndex = 1
******* SAVE GENERAL
**********************
.all.Item("PC_7_0_J3_SAVE").Click
Call is_busy(IE)
********* SUPPLIER TAB
*************************
************************
.getElementById("tab2").Click
Call is_busy(IE)
** determining MSFT Xbox
or Microsoft algorithm
(from the file name)
InStr(1, C_myMacroFile,
"XBox") <> 0 ?
Private Label
Indicator = No
.all.Item("_1552681051_0_
1865545603_0_326364010_
0").Value = "Microsoft
Xbox Corporation"
.all.Item("_1552681051_0_
1865545603_0_326364010_
0").Value = "Microsoft"
.all.Item("_1552681051_0_
2143843476_0_198836717_
0").selectedIndex = 1
Primary Origin Country Indicator = Yes --- BY DEFAULT
IE.document.all.Item("_1552681051_0_1053610938_0_259351390_0").selectedIndex = 2
Country of Origin for BBY Purchase = United States --- BY DEFAULT
IE.document.all.Item("_1552681051_0_1053610938_0_190972293_0").value = United States
For j = 0 To ColQuant - 1
******* SAVE SUPPLIER
TAB ****************
ArrHeaders(j)
= C_NetPrice ?
Unit Cost
.getElementById("_
1552681051_0_1053610938_
0_1408138848_0_
1499822074_0").Value =
MatrixPLfltrd(i, j)
Next j
.all.Item("PC_7_0_J3_SAVE").Click
Call is_busy(IE)
********* LOGISTICS TAB
*************************
************************
.getElementById("tab3").Click
Call is_busy(IE)
»9
** 7 **
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
No
End For
Yes
No
Select Case ArrHeaders(j)
C_ItemName ?
C_PartNumber ?
Best Buy Description
.getElementById("_
215127057_0_1352413751_0_
1366209486_0").Value =
MatrixPLfltrd(i, j)
Description sign
.getElementById("_
215127057_0_1352413751_0_
334658439_0").Value =
MatrixPLfltrd(i, j)
C_UPC ?
Model or Selection
.getElementById("_215127057_0_1742083922_0_233841037_0").Value = MatrixPLfltrd(i, j)
current_SKU = MatrixPLfltrd(i, j)
ReDim Preserve get_arr_of_set_up_SKU(i - 1)
get_arr_of_set_up_SKU(i - 1) = current_SKU
Item comments
.getElementById("_215127057_0_426000597_0_1141097592_0").Value
= "New Item Setup For " &
MatrixPLfltrd(i, j)
C_MSRP ?
UPC type
.all.Item("_215127057_0_
1742083922_0_27072232_0_
2126757239_0")
.selectedIndex = 3
UPC
.getElementById("_215127057_0_1742083922_0_27072232_0_768654447_0").Value = MatrixPLfltrd(i, j)
ReDim Preserve get_arr_of_UPC(i - 1)
get_arr_of_UPC(i - 1) = MatrixPLfltrd(i, j)
Else
Suggested retail
.getElementById("_
215127057_0_249243837_0_
2086194608_0_1833282399_
0").Value =
MatrixPLfltrd(i, j)
Next j
«6
** 8 **
Yes
Yes
Yes
Yes
** Unit Dimensions and Weight *******************
a. Length or Depth = MS Unit Width
b. Width = MS Unit Depth
c. Height = MS Unit Length
d. Dimensions UOM = IN (choose from the drop down)
e. Weight = MS Unit Weight
f. Weight UOM = LB (choose from the drop down)
For j = 0 To ColQuant - 1
UOM - IN or LB
For unit and MP
Select Case ArrHeaders(j)
C_Un_Width ?
C_Un_Depth ?
For iii = 0
To 2
.getElementById("_
1715640154_0_553772606_"
& iii & "_1269885005_0")
.Value =
MatrixPLfltrd(i, j)
Next iii
C_Un_Length ?
For iii = 0
To 2
.getElementById("_
1715640154_0_553772606_"
& iii & "_267338521_0")
.Value =
MatrixPLfltrd(i, j)
Next iii
C_Un_Weight ?
For iii = 0
To 2
.getElementById("_
1715640154_0_553772606_"
& iii & "_735435212_0")
.Value =
MatrixPLfltrd(i, j)
Next iii
Else
For iii = 0
To 2
.getElementById("_
1715640154_0_553772606_"
& iii & "_305997947_0")
.Value =
MatrixPLfltrd(i, j)
Next iii
Next j
For iii = 0
To 3
** Master Pak Dimensions
and Weight ***********
.all.Item("_1715640154_0_553772606_" &
iii & "_354836947_0").selectedIndex = 3
.all.Item("_1715640154_0_553772606_" &
iii & "_434201048_0").selectedIndex = 3
Next iii
For j = 0 To ColQuant - 1
****** Inner, MPQ, TI, HI, IND ****************************
Inner Pack - Number of Eaches = Always 1
Select Case ArrHeaders(j)
C_MP_Length ?
C_MP_Depth ?
.getElementById("_
1715640154_0_553772606_3_
1269885005_0").Value =
MatrixPLfltrd(i, j)
C_MP_Width ?
.getElementById("_
1715640154_0_553772606_3_
267338521_0").Value =
MatrixPLfltrd(i, j)
C_MP_Weight ?
.getElementById("_
1715640154_0_553772606_3_
735435212_0").Value =
MatrixPLfltrd(i, j)
.getElementById("_
1715640154_0_553772606_3_
305997947_0").Value =
MatrixPLfltrd(i, j)
Next j
.getElementById("_
1715640154_0_662665405_0_
1898596981_0").Value = 1
For j = 0 To ColQuant - 1
Call pvtus_SQL_dotaz(TI, HI, current_SKU)
.getElementById("_1715640154_0_662665405_0_1795435815_0").Value = TI
.getElementById("_1715640154_0_662665405_0_1163388972_0").Value = HI
Case Pack - Number of
Eaches = Masterpack Qty
ArrHeaders(j) = C_MPQ ?
Pallet - Number of Eaches
.getElementById("_
1715640154_0_662665405_0_
1429791177_0").Value =
MatrixPLfltrd(i, j)
ArrHeaders(j) =
C_PalletQuantity ?
.getElementById("_
1715640154_0_662665405_0_
400926649_0").Value =
MatrixPLfltrd(i, j)
Next j
One Way Ind = NO --- BY DEFAULT in HTML
BBY Direct Import Ind = No
.all.Item("_1715640154_0_
81096678_0_552511319_0")
.selectedIndex = 1
******* SAVE Logistics
Tab ***************
.all.Item("PC_7_0_J3_SAVE").Click
Call is_busy(IE)
********* DATES TAB
*************************
************************
.getElementById("tab4").Click
Call is_busy(IE)
»10
** 9 **
End For
Yes
Yes
End For
Yes
End For
Yes
End For
End For
End For
End For
Yes
Yes
Yes
Yes
Else
End For
Yes
No
Yes
No
the VBA code cannot see the ID in HTML, so
we will use getElementsByTagName("input")
the indexed order of the input element is 108, starting from 0
slashQ = 0
MM = ""
DD = ""
YY = ""
nechceme Format(Time,
"hh:mm:ss AMPM")
MyTime = Format(Time,
"hh:mm:ss")
MyTime = Mid(MyTime, 1, 8) v pripade, ze by
to bylo deklarovano: Dim MyTime As Date, pak
implicitne pridava AM/PM nezavisle na Formatu,
proto je to Dimenzovano MyTime As String
For j = 0 To ColQuant - 1
BBuy_win = FindWindow(ByVal vbNullString, ByVal "Best Buy PIM
Portal - Windows Internet Explorer")
Call SetFocusAPI(ByVal BBuy_win)
ArrHeaders(j) = C_MSD ?
Len(MatrixPLfltrd(i,
j)) <> 0 ?
For iii = 1 To
Len(MatrixPLfltrd(i, j))
Len(MM) = 1 ?
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 0 ?
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 1 ?
MM = MM +
Mid(MatrixPLfltrd(i,
j), iii, 1)
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 2 ?
DD = DD +
Mid(MatrixPLfltrd(i,
j), iii, 1)
Mid(MatrixPLfltrd(i, j),
iii, 1) = "/" ?
YY = YY +
Mid(MatrixPLfltrd(i,
j), iii, 1)
slashQ = slashQ + 1
Next iii
Len(DD) = 1 ?
MM = "0" + MM
.getElementsByTagName("Form")(0).getElementsByTagName
("input")(108).Value = YY & "-" & MM &
"-" & DD & " " & MyTime
DD = "0" + DD
Next j
For j = 1 To
300
******* SAVE Dates Tab
*******************
Call PostMessage(ByVal BBuy_win, ByVal
WM_KEYDOWN, ByVal VK_TAB, ByVal 0&)
Call PostMessage(ByVal BBuy_win, ByVal
WM_KEYUP, ByVal VK_TAB, ByVal 0&)
ms
Sleep 100
Next j
.all.Item("PC_7_0_J3_SAVE").Click
Call is_busy(IE)
********* Category TAB
*************************
************************
.getElementById("tab5").Click
Call is_busy(IE)
values of category attributes are stored
in the MarketingMatrix - without a header
go through the array ArrMarketDataHeaders and find the header and his
position - index and then refer to the relevant
index of the column in the MarketingMatrix
k = 0
Do While ArrMarketDataHeaders(k) <> "Operating system"
k = k + 1
Loop
IE.document.all.Item("_1562711832_0").selectedIndex
= MarketingMatrix(0, k)
Select Case kategorie
Case "PC_SW_non-VG"
Case "VG_PC_SW"
Case "Zune"
Case "Accessories" 'XBOX
Case "XBOX_Console"
Case "XBOX_SW"
Case "Input_Devices-Game_Controller"
Case "Input_Devices-Mice"
Case "Input_Devices-Keyboards"
Case "Web Cams"
End Select
first - we determine indices of some repeating
attributes to abbreviate the VBA code
vista(0) = "Bus"
vista(1) = "Basic"
vista(2) = "Prem"
vista(3) = "Ultim"
indx_vista = 0
determining of
operating system
k = 0
ArrMarketDataHeaders(k)
<> "Operating system" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
CPU_min(0) = 0#
CPU_min(1) = 1#
CPU_min(2) = 1.5
CPU_min(3) = 1.8
CPU_min(4) = 1.9
CPU_min(5) = 2#
CPU_min(6) = 2.5
CPU_min(7) = 3#
CPU_min(8) = 300#
CPU_min(9) = 400#
CPU_min(10) = 500#
CPU_min(11) = 600#
CPU_min(12) = 700#
CPU_min(13) = 800#
CPU_min(14) = 900#
CPU_min(15) = 1200#
"" ?
"Vista" ?
Not Applicable
index_OS = 6
Else
jen pripad pro
rozrazeni verzi Visty
For j = 7 To 13 Step 2
InStr(1,
MarketingMatrix(i - 1,
k), vista(indx_vista)) ?
indx_vista =
indx_vista + 1
index_OS = j
InStr(1,
MarketingMatrix(i
- 1, k), "64") ?
index_OS = j + 1
Next j
the rest is a combination of Vista/XP ->
prioritize XP (lower version) and for 95, 98 etc.
neberu v bunce ohled.
InStr(1,
MarketingMatrix(i
- 1, k), "XP") ?
index_OS = 16
if we do not have XP in
the offer, then select
Windows generally
index_OS = 15
CPU_min(16) = 1800#
CPU_rcmd(0) = 0#
CPU_rcmd(1) = 1#
CPU_rcmd(2) = 1.5
CPU_rcmd(3) = 2#
CPU_rcmd(4) = 2.5
CPU_rcmd(5) = 3#
CPU_rcmd(6) = 300#
CPU_rcmd(7) = 400#
CPU_rcmd(8) = 500#
CPU_rcmd(9) = 600#
CPU_rcmd(10) = 700#
CPU_rcmd(11) = 800#
CPU_rcmd(12) = 900#
CPU_rcmd(13) = 2500#
determining a
minimum frequency
k = 0
ArrMarketDataHeaders(k)
<> "Min Required
CPU Speed" ?
For j = 0 To
15
k = k + 1
Val(MarketingMatrix(i -
1, k)) >
CPU_min(UBound(CPU_min))
?
Val(MarketingMatrix(i -
1, k)) > CPU_min(j) And
Val(MarketingMatrix(i -
1, k)) <= CPU_min(j +1) ?
index_CPU_min = j + 2
Next j
DETERMINACE UOM -
UNIT OF MEASURE
index_CPU_min =
UBound(CPU_min) + 1
k = 0
ArrMarketDataHeaders(k)
<> "CPU Speed UOM" ?
»13 »12
** 10 **
** 11 **
End For
Yes
No
Yes
No
End For
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
End For
Yes
No
Yes
Yes
End For
Yes
No
Yes
No
Yes
No
Yes
No
End For
Yes
No Yes
No
Yes No
MarketingMatrix(i
- 1, k) = "GHz" ?
determining of a
recommended frequency
index_UOM_min = 1 index_UOM_min = 2
k = 0
ArrMarketDataHeaders(k)
<> "Rcmded CPU Speed" ?
For j = 0 To
12
k = k + 1
Val(MarketingMatrix(i -
1, k)) >
CPU_rcmd(UBound
(CPU_rcmd)) ?
Val(MarketingMatrix(i -
1, k)) > CPU_rcmd(j) And
Val(MarketingMatrix(i -
1, k)) <=
CPU_rcmd(j+ 1) ?
index_CPU_rcm = j + 2
Next j
determining of UOM for
RCMDED CPU SPEED
index_CPU_rcm =
UBound(CPU_rcmd) + 1
k = 0
ArrMarketDataHeaders(k)
<> "Rcmded CPU
Speed UOM" ?
MarketingMatrix(i
- 1, k) = "GHz" ?
k = k + 1
determining a genre
index_UOM_rcm = 1 index_UOM_rcm = 2
k = 0
ArrMarketDataHeaders(k)
<> "Genre" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
determining a rating
"Action" ?
"Adult" ?
index_genre = 1
"Adventure" ?
index_genre = 2
"DEVELOPMENT TOOLS" ?
index_genre = 3
"Educational" ?
index_genre = 4
"Emulators" ?
index_genre = 5
"Family Entertainment" ?
index_genre = 6
"Fighting" ?
index_genre = 7
"Home" ?
index_genre = 8
"Music" ?
index_genre = 9
"Other" ?
index_genre = 10
"Puzzle" ?
index_genre = 11
"Racing" ?
index_genre = 12
"Reference" ?
index_genre = 13
"RPG" ?
index_genre = 14
"action RPG" ?
index_genre = 15
"tactical action
games, shooter" ?
index_genre = 15
"shooter" ?
index_genre = 16
"Simulation" ?
index_genre = 16
"Sports" ?
index_genre = 17
"Strategy" ?
index_genre = 18
"Real Time Strategy" ?
index_genre = 19
"Traditional" ?
index_genre = 19
"Utility" ?
index_genre = 20
"Variety" ?
index_genre = 21
"WRESTLING" ?
index_genre = 22
index_genre = 23
k = 0
ArrMarketDataHeaders(k)
<> "Rating" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
determining a
primary color
"AO" ?
"E" ?
index_rating = 1
"Everyone 10+" ?
index_rating = 2
"EC" ?
index_rating = 3
"Mature M17+" ?
index_rating = 4
"NOT_RATED" ?
index_rating = 7
"RATING_PENDING" ?
index_rating = 9
"Teen" ?
index_rating = 13
"UN_RATED" ?
index_rating = 15
"X_RATED" ?
index_rating = 16
index_rating = 17
k = 0
ArrMarketDataHeaders(k)
<> "Primary Color" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
determining a
secondary color
"Assorted" ?
"Bisque" ?
index_prim = 1
"Black" ?
index_prim = 2
"Blue" ?
index_prim = 3
"Bronze" ?
index_prim = 4
"Brown" ?
index_prim = 5
"Burgundy" ?
index_prim = 6
"Camel" ?
index_prim = 7
"Carbon Fiber" ?
index_prim = 8
"Champagne" ?
index_prim = 9
"Charcoal Grey" ?
index_prim = 10
"Cherry" ?
index_prim = 11
"Clear" ?
index_prim = 12
"Cosmopolitan" ?
index_prim = 13
"Cream" ?
index_prim = 14
"Cyan" ?
index_prim = 15
"Dove" ?
index_prim = 16
"Espresso" ?
index_prim = 17
"Gold" ?
index_prim = 18
"Granite" ?
index_prim = 19
"Green" ?
index_prim = 20
"Grey" ?
index_prim = 21
"Indigo" ?
index_prim = 22
"Ivory" ?
index_prim = 23
"Khaki" ?
index_prim = 24
"Lavender" ?
index_prim = 25
"Light Blue" ?
index_prim = 26
"Light Green" ?
index_prim = 27
"Light Purple" ?
index_prim = 28
"Magenta" ?
index_prim = 29
"Maple" ?
index_prim = 30
"Mossy Oak Camo" ?
index_prim = 31
"Natural Silver" ?
index_prim = 32
"Navy" ?
index_prim = 33
"Not Applicable" ?
index_prim = 34
"Oak" ?
index_prim = 35
"Off White" ?
index_prim = 36
"Olive" ?
index_prim = 37
"Orange" ?
index_prim = 38
"Piano Black" ?
index_prim = 39
"Pink" ?
index_prim = 40
"Platinum" ?
index_prim = 41
"Purple" ?
index_prim = 42
"Red" ?
index_prim = 43
"Rose" ?
index_prim = 44
"Sangria" ?
index_prim = 45
"Sapphire" ?
index_prim = 46
"Silver" ?
index_prim = 47
"Spice" ?
index_prim = 48
"Stainless" ?
index_prim = 49
"Titanium" ?
index_prim = 50
"White" ?
index_prim = 51
"Yellow" ?
index_prim = 52
index_prim = 53
k = 0
ArrMarketDataHeaders(k)
<> "Secondary Color" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
»14
** 12 **
Yes No
Yes
No
End For
Yes
No Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
k = k + 1
«11
** 13 **
determining of a
type of a controller
"Bisque" ?
"Black" ?
index_sec = 1
"Blue" ?
index_sec = 2
"Brown" ?
index_sec = 3
"Cherry" ?
index_sec = 4
"Clear" ?
index_sec = 5
"Cream" ?
index_sec = 6
"Cyan" ?
index_sec = 7
"Espresso" ?
index_sec = 8
"Gold" ?
index_sec = 9
"Green" ?
index_sec = 10
"Grey" ?
index_sec = 11
"Ivory" ?
index_sec = 12
"Khaki" ?
index_sec = 13
"Light Blue" ?
index_sec = 14
"Light Green" ?
index_sec = 15
"Light Purple" ?
index_sec = 16
"Magenta" ?
index_sec = 17
"Maple" ?
index_sec = 18
"Mossy Oak Camo" ?
index_sec = 19
"Natural Silver" ?
index_sec = 20
"Navy" ?
index_sec = 21
"Not Applicable" ?
index_sec = 22
"Oak" ?
index_sec = 23
"Off White" ?
index_sec = 24
"Orange" ?
index_sec = 25
"Pink" ?
index_sec = 26
"Platinum" ?
index_sec = 27
"Purple" ?
index_sec = 28
"Red" ?
index_sec = 29
"Silver" ?
index_sec = 30
"Stainless" ?
index_sec = 31
"Titanium" ?
index_sec = 32
"White" ?
index_sec = 33
"Yellow" ?
index_sec = 34
index_sec = 35
k = 0
»15
** 14 **
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
ArrMarketDataHeaders(k)
<> "Controller Type" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
determining of a type of
a periphery gaming device
"Dance Pad" ?
"Not Applicable" ?
index_cntrl = 1
"Remote" ?
index_cntrl = 2
"Wheel" ?
index_cntrl = 3
"Wired" ?
index_cntrl = 4
"Wireless" ?
index_cntrl = 5
index_cntrl = 6
k = 0
ArrMarketDataHeaders(k)
<> "Gaming
Peripheral Type" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
Select Case kategorie
"Bundle" ?
"Cable" ?
index_peri = 1
"Care" ?
index_peri = 2
"Case" ?
index_peri = 3
"Cheat" ?
index_peri = 4
"Control" ?
index_peri = 5
"Customization" ?
index_peri = 6
"Memory" ?
index_peri = 7
"Multimedia" ?
index_peri = 8
"Networking" ?
index_peri = 9
"Not Applicable" ?
index_peri = 10
"Power" ?
index_peri = 11
"Sound" ?
index_peri = 12
index_peri = 13
kategorie
"PC_SW_non-VG" ?
"VG_PC_SW" ?
Operating system: Not Applicable, Vista Business, Vista Business 64-Bit, Vista Home Basic,
Vista Home Basic 64-Bit, Vista Home Premium, Vista Home Premium 64-Bit,
Vista Ultimate, Vista Ultimate 64-Bit, Windows, XP
.all.Item("_1562711832_
0").selectedIndex
= index_OS
Minimum Required Processor Speed: 0.0, 1.0,
1.5, 1.8, 1.9, 2.0, 2.5, 3.0, 300.0, 400.0
500.0, 600.0, 700.0, 800.0, 900.0, 1200.0, 1800.0
.all.Item("_181242228_0")
.selectedIndex
= index_CPU_min
Minimum Required
Processor Speed
UOM: GHz, MHz
.all.Item("_1834189895_
0").selectedIndex
= index_UOM_min
800 Recommended
Processor Speed: 0.0,
1.0, 1.5, 2.0, 2.5, 3.0,
300.0, 400.0,
500.0, 600.0, 700.0,
.0, 900.0, 2500.0
.all.Item("_1315705878_0").selectedIndex = index_CPU_rcm
Recommended Processor
Speed UOM: GHz, MHz
.all.Item("_1399342147_
0").selectedIndex
= index_UOM_rcm
"Zune" ?
always
Game PlatForm: XBOX_360, (Xbox was discontinued in late 2006)
.all.Item("_366871758_0")
.selectedIndex = 13
Genre: ACTION, ADULT, ADVENTURE, EDUCATIONAL, EMULATORS, FAMILY, ENTERTAINMENT, FIGHTING,
MUSIC, HOME, OTHER, PUZZLE, RACING, REFERENCE, ROLE_PLAYING, SHOOTER, SIMULATION,
SPORTS, STRATEGY, TRADITIONAL, UTILITY, VARIETY, WRESTLING, DEVELOPMENT TOOLS
.all.Item("_127407284_0")
.selectedIndex
= index_genre
Rating: AO, E, E10+, EC, G, INHALANT, M,
NC_17, NOT_RATED, PG, PG_13, R, RATING_PENDING,
RP, T, UN_RATED, X_RATED
.all.Item("_33944436_0")
.selectedIndex
= index_rating
Street Date:
k = 0
ArrMarketDataHeaders(k)
<> "street date" ?
street date must be in
this formate>
YYYY-MM-DD hh:mm:ss
k = k + 1
street_date =
MarketingMatrix(i - 1, k)
If not street dated
Then fill in MSD
street_date = "" ?
BBuy_win = FindWindow(ByVal vbNullString, ByVal
"Best Buy PIM Portal - Windows InternetExplorer")
Call SetFocusAPI(ByVal BBuy_win)
slashQ = 0
MM = ""
DD = ""
YY = ""
MyTime = Format(Time,
"hh:mm:ss")
For j = 0 To ColQuant - 1
ArrHeaders(j) = C_MSD ?
Len(MatrixPLfltrd(i,
j)) <> 0 ?
For iii = 1 To
Len(MatrixPLfltrd(i, j))
Len(MM) = 1 ?
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 0 ?
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 1 ?
MM = MM +
Mid(MatrixPLfltrd(i,
j), iii, 1)
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 2 ?
DD = DD +
Mid(MatrixPLfltrd(i,
j), iii, 1)
Mid(MatrixPLfltrd(i, j),
iii, 1) = "/" ?
YY = YY +
Mid(MatrixPLfltrd(i,
j), iii, 1)
slashQ = slashQ + 1
Next iii
Len(DD) = 1 ?
MM = "0" + MM
.getElementsByTagName
("Form")(0)
.getElementsByTagName
("input")(116).Value =
YY & "-"& MM & "-" & DD
& " " & MyTime
DD = "0" + DD
Next j
.getElementsByTagName
("Form")(0)
.getElementsByTagName
("input")(116).Value =
street_date & " "& MyTime
For j = 1 To
300
Minimum Required Processor Speed: 0.0, 1.0,
1.5, 1.8, 1.9, 2.0, 2.5, 3.0, 300.0, 400.0
500.0, 600.0, 700.0, 800.0, 900.0, 1200.0, 1800.0
Call PostMessage(ByVal BBuy_win, ByVal
WM_KEYDOWN, ByVal VK_TAB, ByVal 0&)
Call PostMessage(ByVal BBuy_win, ByVal
WM_KEYUP, ByVal VK_TAB, ByVal 0&)
ms
Sleep 100
Next j
.all.Item("_1395721575_
0").selectedIndex
= index_CPU_min
Minimum Required
Processor Speed
UOM: GHz, MHz
.all.Item("_1631443692_
0").selectedIndex
= index_UOM_min
Recommended Processor Speed: 0.0, 1.0, 1.5,
2.0, 2.5, 3.0, 300.0, 400.0, 500.0, 600.0,
700.0, 800.0, 900.0, 2500.0
.all.Item("_1312790437_
0").selectedIndex
= index_CPU_rcm
Recommended Processor
Speed UOM: GHz, MHz
.all.Item("_1874924024_
0").selectedIndex
= index_UOM_rcm
Number of Discs: 1
.getElementById("_
876150083_0").Value = 1
"Accessories" ?
CE and Accessory
Primary Color
.all.Item("_268021381_0")
.selectedIndex
= index_prim
CE and Accessory
Secondary Color
.all.Item("_951516279_0")
.selectedIndex
= index_sec
"XBOX_Console" ?
XBOX
Accessory Ind: None = 0, No = 1, Yes = 2
.all.Item("_1642772424_
0").selectedIndex = 2
Controller Type: None,
Dance Pad, Not
Applicable, Remote,
Wheel, Wired, Wireless
.all.Item("_1690754485_
0").selectedIndex
= index_cntrl
Gaming Peripheral Type: None, Bundle, Cable,
Care, Case, Cheat, Control, Customization,
Memory, Multimedia, Networking, Not Applicable, Power, Sound
.all.Item("_569820874_0")
.selectedIndex
= index_peri
"XBOX_SW" ?
CE and Accessory
Primary Color
.all.Item("_400508731_0")
.selectedIndex
= index_prim
CE and Accessory
Secondary Color
.all.Item("_1555794249_
0").selectedIndex
= index_sec
"Input_Devices-Game_
Controller" ?
Game PlatForm:
XBOX_360, event. XBOX
.all.Item("_67462387_0")
.selectedIndex = 20
Genre: ACTION, ADULT, ADVENTURE, EDUCATIONAL, EMULATORS, FAMILY, ENTERTAINMENT, FIGHTING,
MUSIC, HOME, OTHER, PUZZLE, RACING, REFERENCE, ROLE_PLAYING, SHOOTER, SIMULATION,
SPORTS, STRATEGY, TRADITIONAL, UTILITY, VARIETY, WRESTLING, DEVELOPMENT TOOLS
.all.Item("_373149557_0")
.selectedIndex
= index_genre
Rating: AO, E, E10+, EC, G, INHALANT, M,
NC_17, NOT_RATED, PG, PG_13, R, RATING_PENDING,
RP, T, UN_RATED, X_RATED
.all.Item("_1005868565_
0").selectedIndex
= index_rating
Street Date:
k = 0
ArrMarketDataHeaders(k)
<> "street date" ?
street date musi byt ve
Formatu YYYY-MM-DD
hh:mm:ss
k = k + 1
street_date =
MarketingMatrix(i - 1, k)
If not street dated
Then fill in MSD
street_date = "" ?
BBuy_win = FindWindow(ByVal vbNullString, ByVal
"Best Buy PIM Portal - Windows InternetExplorer")
Call SetFocusAPI(ByVal BBuy_win)
slashQ = 0
MM = ""
DD = ""
YY = ""
MyTime = Format(Time,
"hh:mm:ss")
For j = 0 To ColQuant - 1
ArrHeaders(j) = C_MSD ?
Len(MatrixPLfltrd(i,
j)) <> 0 ?
For iii = 1 To
Len(MatrixPLfltrd(i, j))
Len(MM) = 1 ?
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 0 ?
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 1 ?
MM = MM +
Mid(MatrixPLfltrd(i,
j), iii, 1)
Mid(MatrixPLfltrd(i, j),
iii, 1) <> "/"
And slashQ = 2 ?
DD = DD +
Mid(MatrixPLfltrd(i,
j), iii, 1)
Mid(MatrixPLfltrd(i, j),
iii, 1) = "/" ?
YY = YY +
Mid(MatrixPLfltrd(i,
j), iii, 1)
slashQ = slashQ + 1
Next iii
Len(DD) = 1 ?
MM = "0" + MM
.getElementsByTagName
("Form")(0)
.getElementsByTagName
("input")(116).Value =
YY & "-"& MM & "-" & DD
& " " & MyTime
DD = "0" + DD
Next j
.getElementsByTagName
("Form")(0)
.getElementsByTagName
("input")(116).Value =
street_date & " "& MyTime
For j = 1 To
300
Number of Discs: 1
Call PostMessage(ByVal BBuy_win, ByVal
WM_KEYDOWN, ByVal VK_TAB, ByVal 0&)
Call PostMessage(ByVal BBuy_win, ByVal
WM_KEYUP, ByVal VK_TAB, ByVal 0&)
ms
Sleep 100
Next j
.getElementById("_
92864450_0").Value = 1
"Input_Devices-Mice" ?
Accessory Ind:
None, No, Yes
.all.Item("_648190504_0")
.selectedIndex = 2
CE and Accessory
Primary Color
.all.Item("_456433945_0")
.selectedIndex
= index_prim
CE and Accessory
Secondary Color
.all.Item("_1627363851_
0").selectedIndex
= index_sec
Number of Buttons: None,
0, 1, 2, 3, 4, 5, 6
k = 0
ArrMarketDataHeaders(k)
<> "Number of Buttons" ?
Index = Val(MarketingMatrix(i - 1, k)) + 2
.all.Item("_187851846_0").selectedIndex = Index
k = k + 1
"Input_Devices-Keyboards"
?
CE and Accessory
Primary Color
.all.Item("_480222994_0")
.selectedIndex
= index_prim
CE and Accessory
Secondary Color
.all.Item("_851789664_0")
.selectedIndex
= index_sec
Number of Buttons: None,
0, 1, 2, 3, 4, 5, 6
k = 0
ArrMarketDataHeaders(k)
<> "Number of Buttons" ?
Index = Val(MarketingMatrix(i - 1, k)) + 2
.all.Item("_1331524015_0").selectedIndex = Index
k = k + 1
Number of Programmable
Buttons: None,
0, 1, 2, .... 12
k = 0
ArrMarketDataHeaders(k)
<> "Number of
Programmable Buttons" ?
Index = Val(MarketingMatrix(i - 1, k)) + 2
.all.Item("_222122316_0").selectedIndex = Index
k = k + 1
Tilt Wheel: None, No, Yes
k = 0
ArrMarketDataHeaders(k)
<> "Tilt Wheel" ?
MarketingMatrix(i
- 1, k) = "Yes" ?
k = k + 1
Type of Pointing Device:
None, Ball, Laser, Not
Applicable, Optical,
Presenter Mouse
.all.Item("_1057497258_
0").selectedIndex = 2
.all.Item("_1057497258_
0").selectedIndex = 1
k = 0
ArrMarketDataHeaders(k)
<> "Type of
Pointing Device" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
.all.Item("_1914843709_
0").selectedIndex = Index
"Ball" ?
"Bluetrack" ?
Index = 1
"Laser" ?
Index = 2
"Not Applicable" ?
Index = 3
"Optical" ?
Index = 4
"Presenter Mouse" ?
Index = 5
Index = 6
"Web Cams" ?
Backlit Keys:
None, No, Yes
k = 0
ArrMarketDataHeaders(k)
<> "Backlit Keys" ?
MarketingMatrix(i
- 1, k) = "Yes" ?
k = k + 1
Battery Size: None, 9V,
AA, AAA, C, D, Not
Applicable,
Photo, Specialty
.all.Item("_1840074102_
0").selectedIndex = 2
.all.Item("_1840074102_
0").selectedIndex = 1
k = 0
ArrMarketDataHeaders(k)
<> "Battery Size" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
.all.Item("_253158650_0")
.selectedIndex = Index
"9V" ?
"AA" ?
Index = 1
"AAA" ?
Index = 2
"C" ?
Index = 3
"D" ?
Index = 4
"Not Applicable" ?
Index = 5
"Photo" ?
Index = 6
"Specialty" ?
Index = 7
Index = 8
CE and Accessory
Primary Color
.all.Item("_834572842_0")
.selectedIndex
= index_prim
CE and Accessory
Secondary Color
.all.Item("_2079577208_
0").selectedIndex
= index_sec
Mouse Included: None, Ball, Built Into
Keyboard, Laser, No, Optical, Scroller,
Wireless, Wireless Laser, Wireless Optical, Wireless
Scroller
k = 0
ArrMarketDataHeaders(k)
<> "Mouse Included" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
.all.Item("_417869597_0")
.selectedIndex = Index
"Ball" ?
"Built Into Keyboard" ?
Index = 1
"Laser" ?
Index = 2
"No" ?
Index = 3
"Optical" ?
Index = 4
"Scroller" ?
Index = 5
"Wireless" ?
Index = 6
"Wireless Laser" ?
Index = 7
"Wireless Optical" ?
Index = 8
"Wireless Scroller" ?
Index = 9
Index = 10
Multimedia Keys:
None, No, Yes
k = 0
ArrMarketDataHeaders(k)
<> "Multimedia Keys" ?
MarketingMatrix(i
- 1, k) = "Yes" ?
k = k + 1
Number of Keys:
.all.Item("_279444067_0")
.selectedIndex = 2
.all.Item("_279444067_0")
.selectedIndex = 1
k = 0
ArrMarketDataHeaders(k)
<> "Number of Keys" ?
.getElementById("_
2118570484_0").Value =
MarketingMatrix(i - 1, k)
k = k + 1
Number of USB Ports:
None, 0, .. 10
k = 0
ArrMarketDataHeaders(k)
<> "Number of
USB Ports" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
.all.Item("_743999170_0")
.selectedIndex = Index
"0" ?
"1" ?
Index = 1
"2" ?
Index = 2
"3" ?
Index = 3
"4" ?
Index = 4
"5" ?
Index = 5
"6" ?
Index = 6
"7" ?
Index = 7
"8" ?
Index = 8
"9" ?
Index = 9
"10" ?
Index = 10
Index = 11
Built In Microphone:
None, No, Yes
k = 0
ArrMarketDataHeaders(k)
<> "Built In
Microphone" ?
MarketingMatrix(i
- 1, k) = "Yes" ?
k = k + 1
CE and Accessory
Primary Color
.all.Item("_947613075_0")
.selectedIndex = 2
.all.Item("_947613075_0")
.selectedIndex = 1
.all.Item("_1731412480_
0").selectedIndex
= index_prim
CE and Accessory
Secondary Color
.all.Item("_654042830_0")
.selectedIndex
= index_sec
Headphone Connection:
None, Mini Stereo, Not
Applicable, RCA, Wireless
k = 0
ArrMarketDataHeaders(k)
<> "Headphone
Connection" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
.all.Item("_1239705568_
0").selectedIndex = Index
"Mini Stereo" ?
"Not Applicable" ?
Index = 1
"RCA" ?
Index = 2
"Wireless" ?
Index = 3
Index = 4
Headset Included:
None, No, Yes
k = 0
ArrMarketDataHeaders(k)
<> "Headset Included" ?
MarketingMatrix(i
- 1, k) = "Yes" ?
k = k + 1
Software Included: None, Data Recovery Software, Educational Software,
Facial Recognition Software, Music Management Software,
Navigation Software, Not Applicable, Photo Editing Software,
Video Effects Software
.all.Item("_1627316746_
0").selectedIndex = 2
.all.Item("_1627316746_
0").selectedIndex = 1
k = 0
ArrMarketDataHeaders(k)
<> "Software Included" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
.all.Item("_1579521051_
0").selectedIndex = Index
"Data Recovery
Software" ?
"Educational Software" ?
Index = 1
"Facial Recognition
Software" ?
Index = 2
"Music Management
Software" ?
Index = 3
"Navigation Software" ?
Index = 4
"Not Applicable" ?
Index = 5
"Photo Editing
Software" ?
Index = 6
"Video Effects
Software" ?
Index = 7
Index = 8
Webcam Design: None,
Desktop, Laptop,
Not Applicable
k = 0
ArrMarketDataHeaders(k)
<> "Webcam Design" ?
Select Case
MarketingMatrix(i - 1, k)
k = k + 1
.all.Item("_1402083757_
0").selectedIndex = Index
"Desktop" ?
"Laptop" ?
Index = 1
"Not Applicable" ?
Index = 2
Index = 3
Application.Wait (Now + TimeValue("0:00:3"))
.all.Item("PC_7_0_J3_SAVE").Click
Call is_busy(IE)
End With
j = 0
ReDim Preserve PIMId(i - 1)
IE.Document.all.tags
("td")(j).innerTEXT
<> "PIM Id" ?
IE.navigate
"https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml
/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h39gDJgFjGpvqRqCKOcIEg
fW99X4_83FT9AP2C3NCIckdHRQBrdSb8/delta/base64xml/L3dJdyEvd0ZNQUFzQUMvNElVRS82XzBfQ0g!"
PIMId(i - 1) = IE.Document.all.tags("td")(j + 1).innerTEXT
j = j + 1
PIMId(i - 1) = "PIM Id" ?
PIMId(i - 1) =
IE.Document.all.tags
("td")(j + 1).innerTEXT
PIM Id ma 10 cifer,
zacina mezerou
PIMId(i - 1) =
Mid(PIMId(i - 1), 2, 10)
1946 Call is_busy(IE)
done_1 = True
setup the Next SKU
Next i
«5
** 15 **
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes Else
Yes
Yes
Yes
Yes No
Yes
No
End For
Yes
No
Yes
No
End For
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
End For
Yes
Yes
Yes
Yes
Yes
No
Yes
No
End For
Yes
No
Yes
No
End For
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
End For
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Else
Else
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Else
Yes
No
Yes
Yes
Yes
Else
Yes
No
Yes
No

More Related Content

PPTX
JavaScript Proven Practises
DOCX
Ktifkan dulu microsoft visual basic
PPT
Whats new in_csharp4
DOCX
please code in c#- please note that im a complete beginner- northwind.docx
PPTX
Excel vba 2007
PDF
Introduction to ReasonML
PDF
Perkenalan ReasonML
PDF
A Slipshod Check of the Visual C++ 2013 Library (update 3)
JavaScript Proven Practises
Ktifkan dulu microsoft visual basic
Whats new in_csharp4
please code in c#- please note that im a complete beginner- northwind.docx
Excel vba 2007
Introduction to ReasonML
Perkenalan ReasonML
A Slipshod Check of the Visual C++ 2013 Library (update 3)

Similar to ©️ 01_Algorithm for Microsoft New Product Launch - handling web site - by Ales Vymyslicky.pdf (20)

PDF
ASP.Net, move data to and from a SQL Server Database
PPT
Practical Ext JS Debugging
PPT
Advanced Topics On Sql Injection Protection
DOCX
Tony Vitabile .Net Portfolio
PDF
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 1
PDF
PVS-Studio delved into the FreeBSD kernel
ZIP
Yes, But
PDF
Asterisk: PVS-Studio Takes Up Telephony
DOCX
VPN Access Runbook
PDF
Python and Ruby implementations compared by the error density
PDF
2013-06-15 - Software Craftsmanship mit JavaScript
PDF
2013-06-24 - Software Craftsmanship with JavaScript
PDF
So basically I worked really hard on this code in my CS150 class and.pdf
PDF
Analyzing Firebird 3.0
PDF
Analyzing Firebird 3.0
PDF
Javascript part1
PDF
A few words about OpenSSL
PPT
SQL -PHP Tutorial
PPT
Form demoinplaywithmysql
PDF
Picking Mushrooms after Cppcheck
ASP.Net, move data to and from a SQL Server Database
Practical Ext JS Debugging
Advanced Topics On Sql Injection Protection
Tony Vitabile .Net Portfolio
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 1
PVS-Studio delved into the FreeBSD kernel
Yes, But
Asterisk: PVS-Studio Takes Up Telephony
VPN Access Runbook
Python and Ruby implementations compared by the error density
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
So basically I worked really hard on this code in my CS150 class and.pdf
Analyzing Firebird 3.0
Analyzing Firebird 3.0
Javascript part1
A few words about OpenSSL
SQL -PHP Tutorial
Form demoinplaywithmysql
Picking Mushrooms after Cppcheck
Ad

More from none (6)

PDF
©️ 02_SKU Automatic SW Robotics for Microsoft PC.pdf
PPTX
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012
DOCX
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...
DOCX
©️ CISCO RMA Service Order Status Business Function
DOCX
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function
PPTX
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics
©️ 02_SKU Automatic SW Robotics for Microsoft PC.pdf
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...
©️ CISCO RMA Service Order Status Business Function
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics
Ad

Recently uploaded (20)

PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PPTX
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
PPTX
retention in jsjsksksksnbsndjddjdnFPD.pptx
PPT
Image processing and pattern recognition 2.ppt
PDF
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
PPTX
Lesson-01intheselfoflifeofthekennyrogersoftheunderstandoftheunderstanded
PPTX
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
PPTX
CYBER SECURITY the Next Warefare Tactics
PDF
Session 11 - Data Visualization Storytelling (2).pdf
PDF
Global Data and Analytics Market Outlook Report
PPTX
Business_Capability_Map_Collection__pptx
PPT
statistic analysis for study - data collection
PPTX
chrmotography.pptx food anaylysis techni
PPTX
chuitkarjhanbijunsdivndsijvndiucbhsaxnmzsicvjsd
PDF
Best Data Science Professional Certificates in the USA | IABAC
PDF
A biomechanical Functional analysis of the masitary muscles in man
PDF
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
PPT
statistics analysis - topic 3 - describing data visually
PPTX
FMIS 108 and AISlaudon_mis17_ppt_ch11.pptx
PPTX
CHAPTER-2-THE-ACCOUNTING-PROCESS-2-4.pptx
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
retention in jsjsksksksnbsndjddjdnFPD.pptx
Image processing and pattern recognition 2.ppt
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
Lesson-01intheselfoflifeofthekennyrogersoftheunderstandoftheunderstanded
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
CYBER SECURITY the Next Warefare Tactics
Session 11 - Data Visualization Storytelling (2).pdf
Global Data and Analytics Market Outlook Report
Business_Capability_Map_Collection__pptx
statistic analysis for study - data collection
chrmotography.pptx food anaylysis techni
chuitkarjhanbijunsdivndsijvndiucbhsaxnmzsicvjsd
Best Data Science Professional Certificates in the USA | IABAC
A biomechanical Functional analysis of the masitary muscles in man
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
statistics analysis - topic 3 - describing data visually
FMIS 108 and AISlaudon_mis17_ppt_ch11.pptx
CHAPTER-2-THE-ACCOUNTING-PROCESS-2-4.pptx

©️ 01_Algorithm for Microsoft New Product Launch - handling web site - by Ales Vymyslicky.pdf

  • 1. Public Sub Auto_Open()in End .ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)" .CommandBars("Status Bar").Visible = False With Application .CommandBars("Formating") .Visible = False - not in this version .DisplayFormulaBar = False .DisplayScrollBars = False .Caption = " " .ActiveWindow.Caption = "" .ActiveWindow .DisplayHeadings = False .ActiveWindow.DisplayWorkbookTabs = False .ActiveWindow.DisplayVerticalScrollBar = False - also possible .ActiveWindow.DisplayHorizontalScrollBar = False - also possible .WindowState = xlNormal End With make some sheets invisible, such as: Security Warning - Automatic update of links has been disabled For Each theBar In Application.CommandBars Call readMailTXT(get_mailArrOfRQSku, get_subjSKUtoBeSetUpQuant) Call SetupBestBuy Call Notification_Email(get_arr_of_set_up_SKU, PIMId, get_arr_of_UPC, ArrMarketDataHeaders, MarketingMatrix) Call Save_Exit On Error Resume Next theBar.Enabled = False Next End For Each
  • 2. Public Sub Auto_Close() End .ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)" .CommandBars("Status Bar").Visible = True .CommandBars("Formating").Visible = True - not in this version .DisplayFormulaBar = True .DisplayScrollBars = True .ActiveWindow.DisplayHeadings = True .ActiveWindow.DisplayWorkbookTabs = True .ActiveWindow.DisplayVerticalScrollBar = True - also possible .ActiveWindow.DisplayHorizontalScrollBar = True - also possible .Caption = Empty .ActiveWindow.Caption = False .WindowState = xlNormal With Application End With make other sheets visibe again; such as: Security Warning - Automatic update of links has been disabled For Each theBar In Application.CommandBars On Error Resume Next theBar.Enabled = True Next End For Each
  • 3. Public Sub Save_Exit() End Application.DisplayAlerts = False PL_OPEN = True ? Application.Workbooks(C_myMacroFile).Activate Application.Workbooks(C_myMacroFile).Save Application.Quit Application.Workbooks (filePL).Close SaveChanges:=False Yes No
  • 4. Public Function GetOpenIEByURL(ByVal pop_up_URL As String) As SHDocVw.InternetExplorer End VBA MACRO - TOOLS - REFERENCES - BROWSE - go to WINDOWSSYSTEM32shdocvw.dll (will add MICROSOFT INTERNET CONTROL - TICK THIS OPTION) Function uses the SHDocVw.ShellWindows object to iterate the running IE instances ignore errors when accessing the document property On Error Resume Next Loop over all Shell-Windows For Each GetOpenIEByURL In objShellWindows If the document is of type HTMLDocument, it is an IE window TypeName(GetOpenIEByURL .Document) = "HTMLDocument" ? Debug.Print TypeName(GetOpenIEByURL .Document) check the URL GetOpenIEByURL.Document .URL = pop_up_URL ? leave, we found the right window Next End For Each Yes No Yes No
  • 5. Private Function GetXLCol(ByVal Col As Integer) As String End ASCII value For capital A Col is the present column, not the number of cols THIS ALGORITHM ONLY WORKS UP TO ZZ. It fails on AAA Col > 701 ? Col <= 25 ? GetXLCol = "" GetXLCol = sCol sCol = Chr(A + Col) iRemain = Int((Col / 26)) - 1 sCol = Chr(A + iRemain) & GetXLCol(Col Mod 26) Yes No Yes No
  • 6. Sub readMailTXT (mailArrOfRQSku, subjSKUtoBeSetUpQuant) End , subjSKUtoBeSetUpQuant As Byte Open plocha2 & "" & soubor_na_plose For Input Access Read As #1 Not EOF(1) ? subjLength = LOF(1) Close #1 subjSKUtoBeSetUpQuant = 0 Input #1, mailSubject ----00000 until the 4th position, For subjCharNo = 4 To (subjLength - 5) the dash is not relevant is_num = False not_num = False std_chr = False not_std = False Mid(mailSubject, subjCharNo, 1) = "-" ? ASCII code for numerical characters must follow For krok = 1 To 5 Step 1 SKU char to the left must be alphanumeric, lower case will be capitalized t = Asc(Mid(mailSubject, subjCharNo + krok, 1)) (48 <= t And t <= 57) ? is_num = True not_num = True Next krok For krok = 1 To 3 Step 1 not_num = False And Not_std = False ? t = Asc(UCase(Mid (mailSubject, subjCharNo - 4 + krok, 1))) (48 <= t And t <= 57) Or (65 <= t And t <= 90) ? std_chr = True not_std = True Next krok ReDim Preserve mailArrOfRQSku (subjSKUtoBeSetUpQuant) SKU is nine digits long mailArrOfRQSku(subjSKUtoBeSetUpQuant) = UCase(Mid(mailSubject, (subjCharNo - 3), 9)) subjSKUtoBeSetUpQuant = subjSKUtoBeSetUpQuant + 1 Debug.Print Mid(mailSubject, (subjCharNo - 3), 9) Debug.Print mailArrOfRQSku(subjSKUtoBeSetUpQuant - 1) Next subjCharNo Yes No End For Yes No End For Yes No End For Yes No Yes No
  • 7. Sub Notification_Email (ByVal get_arr_of_set_up_ SKU, ByVal PIMId, ByVal get_arr_of_UPC, ByVal ArrMarketDataHeaders, ByVal MarketingMatrix) End works in Office 2000-2007 p = 0 Application.DisplayAlerts = False this error subscript out of range in the field get_arr_of_set_up_SKU will occur when we are not logged in to corporate network, thus opening of Price List will return this error On Error GoTo Chyby2 and then we run this procedure with arrays that have no dimensions, thus this procedure would return another error -> finish makro -> RAS Set OL_App = CreateObject("Outlook.Application") OL_App.Session.Logon Set OL_Mail = OL_App.CreateItem(0) message = False SetUpQuant <> 0 And done_1 = True ? signature = "Regards," & vbNewLine & vbNewLine & "Ales Vymyslicky (Accenture)" & vbNewLine & "E&D NAOC Transaction Team" & vbNewLine & "tel: + 420 225 042 496" & vbNewLine & "e-mail: v-alvymy@microsoft.com" On Error Resume Next mailBody_part1 = "Hello everyone," & vbNewLine & vbNewLine & "Please be inFormed that the " UBound(get_arr_ of_set_up_SKU) < 1 ? mailSubject = "" mailBody_part3 = "" mailBody_part2 = "item below has been set up on the PIM portal:" & vbNewLine & vbNewLine mailBody_part2 = "items below have been set up on the PIM portal:" & vbNewLine & vbNewLine For m = 0 To UBound(get_arr_of_ set_up_SKU) message = True mailSubject = mailSubject & get_arr_of_set_up_SKU(m) & " ; " mailBody_partX = "This is the PIM Id# " & PIMId(m) & vbNewLine & "This is the UPC# " & get_arr_of_UPC(m) & vbNewLine & "This is the SKU# " & get_arr_of_set_up_SKU(m) & vbNewLine & vbNewLine mailBody_part3 = mailBody_part3 & mailBody_partX For n = 0 To UBound(ArrMarketDataHeaders) ArrMarketDataHeaders(n) = "1st Image" Or ArrMarketDataHeaders(n) = "2nd Image" ? ReDim Preserve photographs(p) photographs(p) = MarketingMatrix(m, n) p = p + 1 Next n Next m done_2 = True ? nic z toho nemohlo byt naset-upovano mailBody_part1 = zprava & vbNewLine & vbNewLine (neni na PL), mohou nastat pripady: vse bylo udelano, nic nebylo udelano, neco z toho bylo udelano, neco bylo udelano a zbytek neni na PL, do budoucna pripad bylo udelano drive message = True message = True ? On Error GoTo 0 Set OL_Mail = Nothing Set OL_App = Nothing "skuaoc@winse .microsoft.com" With OL_Mail .SentOnBehalfOfName = "v-alvymy@microsoft.com" .To = "v-annahe@microsoft.com; v-ivoten@microsoft.com" .CC = "skuaoc@winse.microsoft.com" .BCC = "" .Subject = "SKU set-up notification for the " & mailSubject .Body = mailBody_part1 & mailBody_part2 & mailBody_part3 & signature For p = 0 To UBound(photographs) or use .Send straight away .Attachments.Add (photographs(p)) Next p .Display End With Chyby2: Application .DisplayAlerts = False Application.Quit Yes No Yes No End For End For Yes No Yes No Yes No End For
  • 8. Private Sub is_busy(ByVal internet) End .Busy ? With internet .ReadyState <> 4 ? DoEvents End With DoEvents Application.Wait (Now + TimeValue("0:00:3")) Yes No Yes No
  • 9. Sub pvtus_SQL_dotaz(tier, layer, ByVal current_SKU) End Set objRecordset = CreateObject("ADODB.Recordset") PartN = "'" & current_SKU & "'" objConnection.Open "Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=AdHocReporting;Data Source=Homedepot;Use Procedure For Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=OM761600;Use Encryption For Data=False;Tag With column collation when possible=False" strSQL = "SELECT EndItemPallet.EndItemPalletID, EndItemPallet.EndItemOperationsViewID, EndItemPallet.PalletSizeCodeID, EndItemPallet.PalletQuantity, EndItemPallet.PalletTie, EndItemPallet.PalletLayers, EndItemOperationsView.EndItemOperationsViewID, EndItemOperationsView.MaterialID, Material.MaterialID, Material.PartNumber FROM AdHocReporting.dbo.EndItemOperationsView EndItemOperationsView, AdHocReporting.dbo.EndItemPallet EndItemPallet, AdHocReporting.dbo.Material Material WHERE (Material.MaterialID = EndItemOperationsView.MaterialID) AND (EndItemPallet.EndItemOperationsViewID = EndItemOperationsView.EndItemOperationsViewID) AND (EndItemPallet.PalletSizeCodeID=1204) AND (Material.PartNumber=" & PartN & ")" objRecordset.Open strSQL, objConnection tier = objRecordset.Fields.Item("PalletTie").Value layer = objRecordset.Fields.Item("PalletLayers").Value pom = objRecordset.Fields .Item("PartNumber").Value
  • 10. Sub SetupBestBuy() End SetUpQuant udava SKUtoBeSetUpQuant - notSetUpQuant(realna-co je na PL) SetUpQuant udava pri Dimenzovani MatrixPLfltrd index radku vcetne zahlavi bude nacitat ruzne cis Formaty, aby se pak dodrzely pro ucely Formula row, kde pridava Excel ve slove Fry's jeste jeden quote na vic input field input field login button PLtab = "Price List Report" Application.OnTime Now + TimeValue("00:30:00"), "Save_Exit" 'autotermination If error and no response in 30 mins Then autotermination, however problem With multiple set-ups - how long period? For 6 SKUs, maybe 3 hours. For 1 Sku, 30 min Saving to Best Buy database via portal is extremely slow -> 1 set-up takes 25 min reseni: cas, za ktery nastane autoterminace by se mohl menit = SetUpQuant * 30 min MyDate contains the current system date. MyDate = Date MyDay = Day(MyDate) MyMonth = Month(MyDate) MyYear = Year(MyDate) YY = MyYear Mod 100 YY = "0" & YY MyMonth < 10 ? MyDay >= 15 ? MM = "0" & MyMonth MM = MyMonth ***** Tracking down the latest pathPL and actual filePL name *** (or the 2nd latest)** ***** IT Connection Manager must be connected via RAS Card !!! ******************* DD = "15" DD = "01" On Error GoTo Chyby pathPL = pathPL_C1 & MM & DD & YY & pathPL_C2 typeselection = "*.xls" the first listed filePL will be loaded into the filePL string variable otherwise an Empty string filePL = Dir(pathPL & typeselection, vbReadOnly) searching For the substring, returns 0 If not found filePLSubstringIND = InStr(1, filePL, C_SubString) alternatively, to be more specific: If filePLSubstringIND = 14 Then filePLSubstringIND <> 0 ? Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True PL_OPEN = True On Error GoTo PLnotReady account name starts always on the 14th character so it could be: Do filePLSubstringIND = 0 ? filePLSubstringIND <> 14 ? read the Next filePL in the directory If there is none Then an Empty string will be assigned filePL = Dir() filePLSubstringIND = InStr(1, filePL, C_SubString) filePLSubstringIND <> 0 ? PLnotReady: ***** Tracking down the 2nd latest PL pathPL and its name If filePLSubstringIND = 0 *************** ***** from now on it will continue With opening the PL belonging to the previous period Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True PL_OPEN = True filePLSubstringIND = 0 ? If PL is not Ready ***** How many arrays are there on the PL? + Loading the headers into an array + Searching For the PartNumber Response = MsgBox("The pathPL " & pathPL & " does not exist, has been changed, or the latest PL has not been issued yet. Would you like to try to open the older one?", vbYesNo + vbCritical) If NO - GOTO chyby, PL neni dostupny, see Else na radku 106 Response = vbYes ? ***** start reading the PL from the preceding period ***** MyDay >= 15 ? DD = "01" pathPL = pathPL_C1 & MM & DD & YY & pathPL_C2 typeselection = "*.xls" the first listed filePL will be loaded into the filePL string variable otherwise an Empty string filePL = Dir(pathPL & typeselection, vbReadOnly) filePLSubstringIND = InStr(1, filePL, C_SubString) filePLSubstringIND <> 0 ? Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True PL_OPEN = True On Error GoTo Chyby filePLSubstringIND = 0 ? filePL = Dir() filePLSubstringIND = InStr(1, filePL, C_SubString) filePLSubstringIND <> 0 ? Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True PL_OPEN = True DD = "15" MyMonth <= 10 ? pathPL = pathPL_C1 & MM & DD & YY & pathPL_C2 typeselection = "*.xls" MyMonth = 1 ? MM = "12" YY = (MyYear Mod 100) - 1 YY = "0" & YY MyMonth = MyMonth - 1 MM = "0" & MyMonth MyMonth = MyMonth - 1 MM = MyMonth the first listed filePL will be loaded into the filePL string variable otherwise an Empty string filePL = Dir(pathPL & typeselection, vbReadOnly) filePLSubstringIND = InStr(1, filePL, C_SubString) filePLSubstringIND <> 0 ? Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True PL_OPEN = True On Error GoTo Chyby account name starts always on the 14th character filePLSubstringIND = 0 ? read the Next filePL in the directory If there is none Then an Empty string will be assigned filePL = Dir() filePLSubstringIND = InStr(1, filePL, C_SubString) filePLSubstringIND <> 0 ? Workbooks.Open Filename:=pathPL & "" & filePL, ReadOnly:=True PL_OPEN = True ***** Else response is vbNo Header ******* Application.ScreenUpdating = False !!! nutno aktivovat spravny tab !!! Workbooks(filePL).Sheets(PLtab).Activate Range("A1").Select Header = ActiveCell.FormulaR1C1 ColQuant = 0 Header <> Empty ? MID is a text Function and it returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify ActiveCell.Address returns the address in $F$1 Format, so we need the position 2 ***** Refreshing the "Is the SKU on the PL? " CELLS - Column B ****************** ***** according to the latest MM DD YY Tiger's PL ********************************* ColQuant = ColQuant + 1 ColNo = ActiveCell.Column ReDim Preserve ArrHeaders(ColQuant - 1) ArrHeaders(ColQuant - 1) = Header ReDim Preserve ArrVirtualColumnLetters(ColQuant - 1) ColNo < 27 ? ArrVirtualColumnLetters (ColQuant - 1) = ColLetter ColLetter = Mid(ActiveCell.Address, 2, 1) Header = C_MSSKU ? SKUColLetter = Mid(ActiveCell.Address, 2, 1) ColNoSku = ColNo teoreticky pro $AA$1 ColLetter = Mid(ActiveCell.Address, 2, 2) Header = C_MSSKU ? SKUColLetter = Mid(ActiveCell.Address, 2, 1) ColNoSku = ColNo virtual - slupec nemusi existovat, pocet se muze menit ActiveCell.Offset(0, 1).Select Header = ActiveCell.FormulaR1C1 Windows(C_myMacroFile).Activate Sheets(C_myMacroSheet).Range("A2:B12").Select Selection.ClearContents Qfile = MM & DD & YY & FDQuote Const FDQuote = "_MS_PC_Fry''s.xls" 'pro ucely Formula row - specifically for FRYS containing quote PLtab = "Price List Report" assigning quote uv = "'" Range("A1").Select For increment = 0 To get_subjSKUtoBeSetUpQuant - 1 Range("A2").Select increment = 2 writing input SKUs from emailSKUinputSKUsBEPC .txt to worksheetu ActiveCell.Offset (increment + 1, 0).Value = get_mailArrOfRQSku (increment) Next increment konvertuje byte na string automatickym prirazenim incstring = increment RQSkuCELL = "A" & incstring SKUtoBeSetUp = ActiveCell.FormulaR1C1 osetreni chyb lze vynechat, v pripade chyby vraci vlookup do bunky #N/A , t.j. nenalezl On Error Resume Next Err.Clear SKUtoBeSetUpQuant = 0 SKUtoBeSetUp <> Empty ? ***** End of refreshing ********************************************************* ***** Records refreshing in line With the inputted SKUs ************************* ***** Printing headers ********************************************************** ?there is one extra value in the array, we wont need it, it is an address of the last empty cell ReDim Preserve ArrOfRQSkuCELL(SKUtoBeSetUpQuant) ArrOfRQSkuCELL(SKUtoBeSetUpQuant) = RQSkuCELL ReDim Preserve ArrOfRQSku(SKUtoBeSetUpQuant) ArrOfRQSku(SKUtoBeSetUpQuant) = SKUtoBeSetUp increment = increment + 1 cellTEXT = "=If(iserror(vlookup(" & RQSkuCELL & "," & uv & "[" & Qfile & "]" & PLtab & uv & "!$" & SKUColLetter & ":$" & SKUColLetter & ", 1, False)), 0, 1)" ActiveCell.Offset(0, 1).Value = cellTEXT ReDim Preserve ArrOfPLind(SKUtoBeSetUpQuant) ActiveCell.Offset(0, 1).Value = 1 ? SKUtoBeSetUpQuant = SKUtoBeSetUpQuant + 1 incstring = increment RQSkuCELL = "A" & incstring ArrOfPLind (SKUtoBeSetUpQuant) = True ArrOfPLind (SKUtoBeSetUpQuant) = False If Err.Number = 0 Then MsgBox "The SKU has been found on the current Fry's PL" Else MsgBox "The SKU is not on the current Fry's PL" (jinak pro vsechny ostatni chyby by mohl zobrazit tento MsgBox) End If ActiveCell.Offset(1, 0).Select SKUtoBeSetUp = ActiveCell.FormulaR1C1 For i = 1 To ColQuant Step 1 ***** Clearing cells ************************* ******************* **************** Range("A15").Select ActiveCell.Offset(0, i - 1).Value = ArrHeaders(i - 1) Next i Sheets(C_myMacroSheet).Range("A16:AC26").Select Selection.ClearContents ***** Loading SKUtoBeSetup one by one: Do While SKUtoBeSetUp <> Empty *********** Range("A2").Select SKUtoBeSetUp = ActiveCell.FormulaR1C1 zajistime filtrovani az od druheho radku SKU sloupce SkuColRange1 = SKUColLetter & "2" w = 0 y = 0 notSetUpQuant = 0 nacita z input array dokud nenarazi na Empty cell rowVirtual = 1 SKUtoBeSetUp <> Empty ? Chyby: nelzeulozit: »3 »4 ** 1 ** ** 2 ** Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No End For Yes No Yes No End For Yes No
  • 11. ***** loading cells that might be used into a matrix a zkouska tisku ************** SetUpQuant = SKUtoBeSetUpQuant - notSetUpQuant SetUpRowFltrd = 0 Windows(C_myMacroFile).Activate Sheets(C_myMacroSheet).Select Range("a15").Select napr 0 az SetUpQuant, 0 az 28 = 29 sloupcu ReDim MatrixPLfltrd (SetUpQuant, ColQuant - 1) For i = 0 To w from now on we shall only print the matrix just to test values and Formates ActiveCell <> Empty ? Do While ActiveCell = Empty 'preskoci prazdne bunky ActiveCell.Offset(1, 0).Select Loop For j = 0 To ColQuant - 1 SetUpRowFltrd = SetUpRowFltrd + 1 ActiveCell.Offset(1, -ColQuant).Select !!! value!!! MatrixPLfltrd (SetUpRowFltrd, j) = ActiveCell.Value vezme vyslednou hodnotu vzorce a ne vzorec v dane bunce a ulozi hodnotu do MatrixPLfltrd, to je rozdil od ActiveCell.Formula[R1C1] ActiveCell.Offset(0, 1).Select Next j ActiveCell.Offset(1, 0).Select Next i Range("a29").Select tisk bez zahlavi -> od 1 ne od 0 For i = 1 To SetUpQuant Workbooks(filePL).Close False - pokud zavru PL tak indirect bude ukazovat ihned REF OPEN MARKETING & TECHNICAL DATA SHEET ********************************************* For j = 0 To ColQuant - 1 ActiveCell.Offset(1, -ColQuant).Select Select Case MatrixPLfltrd(0, j) ActiveCell.Value = MatrixPLfltrd(i, j) ActiveCell.Offset(0, 1).Select C_MSD ? C_DateDiscontinued ? Selection.NumberFormat = "mm/dd/yy" C_StartEffectiveDate ? Selection.NumberFormat = "mm/dd/yy" C_EndEffectiveDate ? Selection.NumberFormat = "mm/dd/yy" C_UPC ? Selection.NumberFormat = "mm/dd/yy" C_MPQ ? Selection.NumberFormat = "0" C_PalletQuantity ? Selection.NumberFormat = "0" C_NetPrice ? Selection.NumberFormat = "0" C_MSRP ? Selection.NumberFormat = "0.00" C_Un_Weight ? Selection.NumberFormat = "0.00" C_Un_Length ? Selection.NumberFormat = "0.00" C_Un_Width ? Selection.NumberFormat = "0.00" C_Un_Depth ? Selection.NumberFormat = "0.00" C_MP_Weight ? Selection.NumberFormat = "0.00" C_MP_Length ? Selection.NumberFormat = "0.00" C_MP_Width ? Selection.NumberFormat = "0.00" C_MP_Depth ? Selection.NumberFormat = "0.00" Else Selection.NumberFormat = "0.00" Selection.NumberFormat = "GENERAL" Next j Next i On Error GoTo Chyby vyhledame z marketingove databaze jen ta SKU, ktera jsou na PL Workbooks.Open Filename:=plocha & "" & C_myMarketData, ReadOnly:=True !!! nutno aktivovat spravny tab !!! Workbooks(C_myMarketData).Sheets("Sheet1").Activate Range("A1").Select MarketDataHeader = ActiveCell.FormulaR1C1 MarketDataColQuant = 0 MarketDataHeader <> Empty ? ReDim MarketingMatrix (SetUpQuant - 1, MarketDataColQuant - 1) MarketDataColQuant = MarketDataColQuant + 1 ReDim Preserve ArrMarketDataHeaders(MarketDataColQuant - 1) ArrMarketDataHeaders(MarketDataColQuant - 1) = MarketDataHeader ActiveCell.Offset(0, 1).Select MarketDataHeader = ActiveCell.FormulaR1C1 For i = 1 To SetUpQuant Application.DisplayAlerts = False Application.Workbooks(C_myMarketData).Close SaveChanges:=False current_SKU = MatrixPLfltrd(i, ColNoSku - 1) k = 0 ArrMarketDataHeaders(k) <> C_PartNumber ? ArrMarketDataHeaders(k) = C_PartNumber ? k = k + 1 Range(SKUColLetter & "1").Activate SKUColLetter = GetXLCol(ByVal k) ted vyhledame to current_SKU jestli v te databazi je (melo by byt, kdyz je na PL), a jestli vsechny atributy jsou vyplnene to nebudeme zjistovat - databazi je nutno aktualizovat kazdych 14 dni - Pokud databaze nebude aktualni (SKU nenalezeno), pak cyklus pobezi do posledniho radku Excelu a nastane chyba -> makro se ukonci, coz je dobre, aby nesetupoval pak v kategoriich nesmysly !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Muzem vypsat hlaseni, ze databaze atributu neni aktualni. !!!!!!!!!!!!!!!!!!dodelat done = False current_SKU <> ActiveCell.FormulaR1C1 And done = False ? ActiveCell.Offset(1, 0).Select current_SKU = ActiveCell.FormulaR1C1 ? R = ActiveCell.Row Range("A" & R).Activate For jj = 0 To MarketDataColQuant - 1 done = True MarketingMatrix(i - 1, jj) = ActiveCell .Offset(0, jj).Value Next jj Next i kontrolni bajt, ze minimalne 1 SKU bylo nasetupovano *********************** CYKLUS - SKU SETUP ************************************** *** pro vsechna SKU -> i = 1 To SetUpQuant ************************************** done_1 = False kontrolni bajt rika, ze alespon 1 SKU bylo submitovano done_2 = False kontrolni bajt rika, ze jsme se presvedcili o pravdivosti If SetUpQuant <> 0 Then done_3 = False a ze nenastala chyba On Error GoTo nelzeulozit Set IE = Nothing On Error GoTo nelzeulozit SetUpQuant <> 0 ? Application .ScreenUpdating = True nebereme v uvahu prvni radek MatrixPLfltrd - zahlavi; vyuzijeme pro prehlednost For i = 1 To SetUpQuant or Call is_busy(IE) ArrHeaders If ArrOfPLind(i - 1) = True Then IE Is Nothing ? IE.Busy And Not IE.ReadyState = 4 ? Set IE = CreateObject ("InternetExplorer .Application") .Left = 50 .Top = 50 .Height = 800 .Width = 1000 .MenuBar = 0 .Toolbar = 1 .StatusBar = 0 .navigate C_PIMPORTAL_LOGIN With IE wait a while until IE has finished to load Call is_busy(IE) OR eq: Do While IE.busy And Not IE.readystate = 4 : DoEvents : Loop .Visible = 1 End With login - enter ID, pass and click OK .getElementById(C_element_userID).Value = C_myID .getElementById(C_element_password).Value = C_myPW .getElementById(C_element_PC_7_0_64__login).Click With IE.Document End With Call is_busy(IE) click on Item induction RUN the JAVASCRIPT Function from Within VBA (Function PC_7_0_IS_openURL in the HTML) DoEvents IE.Document.all.Item Call IE.Document.parentWindow.execScript ("javascript:PC_7_0_IS_openURL('Item Induction')", "JavaScript") Call is_busy(IE) Excell VBA Calls the Javascript Function openItemNew Complete Non Data Pool Item - should be New - an mistake in HTML - does not effect anything IE.Document.all.Item Call IE.Document.parentWindow.execScript("javascript:openItemNew('Complete Non Data Pool Item')", "JavaScript") Call is_busy(IE) Wait and fill in the Form ******** SELECT CATEGORY AND GENERAL TAB ******************************* IE.Document.all.Item("PC_7_0_J3_Category").Click Call is_busy(IE) pop_up_URL = "https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml /04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h3DgDJgFjGpvqRqCKOcAFf j_zcVP0gfW_9AP2C3NCIckdHRQDCtOS9/delta/base64xml /L0lJWWtpQ1NZL0lGakFBQVRBQUNKQUFNekNxcUEhLzRJVUdSWVFxTkhwQ0d3ZyE vNl8wX0NULzdfMF9MVS82XzBfQ1A!?CATALOG_NAME=Trade Item Catalog&ATTR_NAME=&KEY_CATEGORY_SELECTION=YES&KEY_ITEM_ID=null&KEY_GPC_CATEGORY=&KEY_COLLAB_ID=Item Induction&WF_ITEM=True" funkce v deklaracni casti vraci Set pop_up = GetOpenIEByURL (pop_up_URL) objekt ze sbirky oken shellu * V matici musim zjistit cisla sloupcu tech poli podle kterych budu zarazovat do kategorii v kazdem pripade je mandatorni ColNoItemName a ColNoBusUnit, v pripade ColNoDivName, ColNoProType, ColNoLegalName je potreba tyto promenne take inicializovat, protoze nebudou soucasti pole Headeru ArrHeaders na Xbox ceniku, jinak by byla chyba pri testovani. I kdyz nebudeme napr. ColNoDivName potrebovat pri otevrenem Xbox ceniku, musime nastavit tuto promennou napr. na 1 a bude pak odkazovat na PriceListName = "UNITED STATES BEST BUY USD FPP" sloupec, takze vysledek jakehokoliv testovani na nejaky substring bude stejne 0. ColNoDivName = 1 ColNoProType = 1 ColNoLegalName = 1 For j = 0 To (ColQuant - 1) * determinace kategorie na bazi ItemName, BusUnit, DivName, ProType Predpoklad, ze kategorie je PC_SW_non_VG Select Case ArrHeaders(j) C_ItemName ? C_LegalName ? ColNoItemName = j + 1 C_BusUnit ? ColNoLegalName = j + 1 C_DivName ? ColNoBusUnit = j + 1 C_ProType ? ColNoDivName = j + 1 ColNoProType = j + 1 Next j kategorie = "PC_SW_non-VG" InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "ZUNE") <> 0 ? InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "XBOX") <> 0 ? kategorie = "Zune" InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "ACCESSORIES") <> 0 ? sluzi jen k upresneni buyera kategorie = "Zune_Accessories" InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "WINDOWS GAMING") <> 0 ? kategorie = "Accessories" InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "CONSOLE") <> 0 ? InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "PARTY") <> 0 ? kategorie = "XBOX_Console" InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "XNA 360") <> 0 ? kategorie = "XBOX_SW" InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "LIVE") <> 0 ? kategorie = "XBOX_SW" If InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "CNTRL") <> 0 Or InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "CONTROLLER") <> 0 Or InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "CONTROLLR") <> 0 Or InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "CNTRLR") <> 0 Or InStr(1, UCase(MatrixPLfltrd(i, ColNoItemName - 1)), "WHEEL") <> 0 Or InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "GAMING DEVICES") <> 0 Then kategorie = "Input_Devices-Game_Controller" kategorie = "Accessories" InStr(1, UCase(MatrixPLfltrd(i, ColNoDivName - 1)), "SDA HARDWARE") <> 0 ? kategorie = "VG_PC_SW" Select Case kategorie kategorie = "PC_Hardware" InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "MOUSE") <> 0 ? InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "KEYBOARD") <> 0 ? kategorie = "Input_Devices-Mice" InStr(1, UCase(MatrixPLfltrd(i, ColNoBusUnit - 1)), "ICE") <> 0 ? kategorie = "Input_Devices-Keyboards" InStr(1, UCase(MatrixPLfltrd(i, ColNoLegalName - 1)), "MOUSE") <> 0 ? kategorie = "Web Cams" InStr(1, UCase(MatrixPLfltrd(i, ColNoLegalName - 1)), "KEYBOARD") <> 0 ? kategorie = "Input_Devices-Mice" InStr(1, UCase(MatrixPLfltrd(i, ColNoLegalName - 1)), "NOTEBOOK") <> 0 ? kategorie slouzi jen k upresneni buyera kategorie = "Input_Devices -Notebook_Mice" kategorie = "Input_Devices-Keyboards" j = 0 "Input_Devices-Game_ Controller" ? "Input_Devices-Keyboards" ? super_html_kategorie = " Computer and Video Game Control and Input Devices" html_kategorie = " Game Controllers" "Input_Devices-Mice" ? super_html_kategorie = " Computer and Video Game Control and Input Devices" html_kategorie = " Keyboards" "Input_Devices -Notebook_Mice" ? super_html_kategorie = " Computer and Video Game Control and Input Devices" html_kategorie = " Mice and Trackballs" "Accessories" ? super_html_kategorie = " Computer and Video Game Control and Input Devices" html_kategorie = " Mice and Trackballs" "Web Cams" ? super_html_kategorie = " Computer and Video Game Peripherals" html_kategorie = " Video Game Accessory" "PC_SW_non-VG" ? super_html_kategorie = " Computer and Video Game Peripherals" html_kategorie = " Web Cameras" "VG_PC_SW" ? super_html_kategorie = " Computer and Video Game Software" html_kategorie = " Software Non-Games" "XBOX_SW" ? super_html_kategorie = " Computer and Video Game Software" html_kategorie = " Video Game Computer Software" "XBOX_Console" ? super_html_kategorie = " Computer and Video Game Software" html_kategorie = " Video Game Software" "Zune" ? super_html_kategorie = " Video Game Consoles" html_kategorie = " Video Game Hardware - Non Portable" "Zune_Accessories" ? super_html_kategorie = " Video Game Consoles" html_kategorie = " Video Game Hardware - Portable" super_html_kategorie = " Video Game Consoles" html_kategorie = " Video Game Hardware - Portable" Call is_busy(pop_up) pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(2).Click Call is_busy(pop_up) pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(4).Click Call is_busy(pop_up) pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(2).Click Call is_busy(pop_up) pop_up.Document.all.tags ("a")(j).innerTEXT <> super_html_kategorie ? pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(j - 1).Click Call is_busy(pop_up) jj = 0 j = j + 1 pop_up.Document.all.tags ("a")(jj).innerTEXT <> html_kategorie ? pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(jj).Click Call is_busy(pop_up) pop_up.Document.getElementsByTagName("Form")(0).getElementsByTagName("a")(j - 1).Click jj = jj + 1 *** EXIT POP-UP With saving: **** Call is_busy(pop_up) pop_up.Document.all.Item ("600000017///800000079") .Click 'item name differs depending on how the category tree is expanded pop_up.Document.getElementsByTagName("Form") (0).getElementsByTagName("input")(9).Click Call is_busy(IE) Set pop_up = Nothing For j = 0 To ColQuant - 1 With IE.Document IE.Busy And Not IE.ReadyState = 4 ? Application.Wait (Now + TimeValue("0:00:3")) IE.Document.all.Item Call IE.Document.parentWindow.execScript("javascript:PC_7_0_IS_openURL('Item Induction')", "JavaScript") Call is_busy(IE) IE.Document.all.Item("PC_7_0_J1_WORKFLOW_SELECT").Click Call is_busy(IE) IE.navigate "https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml /04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h39gLJgFjGpvqRqCKOcAFf j_zcVP0gfW_9AP2C3NCIckdHRQAl6aCR/delta/base64xml /L0lDU0lKQ1RPN29na21DU1Evb0tvUUFBSVFnakZJQUFRaENFSVFqR0VKemdBIS8 DoEvents 0 SkZpQ28wZWgxaWNvblFWR2h kLXNJZDJFQSEhLzdfMF9KMS8y NzIvc2EuU1RFUE5BTUU!?PC_ 7_0_J1_STEPNAME=Complete %20Non%20Data%2 0 Pool%20Item&PC_7_0_J1_COLLABAREA_ID=Item%20Induction&PC_ 7_0_J1_WORKFLOW_ID=Item%20Induction%20Workflow%20v1#7_0 _J1" Call is_busy(IE) Application.Wait (Now + TimeValue("0:00:3")) For i = 0 To SetUpQuant - 1 Call is_busy(IE) equival j = 0 IE.Document.all.tags ("td")(j).innerTEXT <> PIMId(i) ? IE.Busy And Not IE.ReadyState = 4 ? j = j + 1 IE.Document.all.tags ("td")(j).innerTEXT = PIMId(i) ? IE.Document .getElementsByTagName ("td")(j - 1).getElementsByTagName ("input")(0).Checked = True DoEvents Next i IE.Busy And Not IE.ReadyState = 4 ? done_2 = True DoEvents LOG OUT IE.navigate "https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml /04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h39gLJgFjGpvqRqCKOcAFf j_zcVP0goESkOVDEy1A_Kic1PTG5Uj9Y31s_QL8gNzSi3NvREQD-ps- S/delta/base64xml/L0lKSklKSWchL0lCakFBR3lBQkVRaUlBISEvNElENnhCX1dFTkRDLzEwOTUvMTM3NzIvbG8!" zavrit browser IE.Quit znicit objekt Set IE = Nothing je-li SetUpQuant = 0 nevytvori se ani instance internet exploreru none of them zprava = "The requested SKU/SKUs is/are not on the BestBuy PC PL" kontrola, ze nenastala chyba logovani do IE, ale SetUpQuant je opravdu 0 done_3 = True pri cteni souboru muze teoreticky nastat nasledujici «1 »8 »7 ** 4 ** ** 5 ** ** 6 ** End For Yes No End For End For End For Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No End For Yes No Yes No Yes No Yes No End For Yes No End For Yes No Yes No End For Yes Yes Yes Yes Yes Else Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes No End For Yes No End For Yes No Yes No Yes No Yes No
  • 12. Workbooks(filePL).Sheets (PLtab).Activate vybere napriklad bunku F2 Range(SkuColRange1).Select SKU = ActiveCell.FormulaR1C1 (SKU <> SKUtoBeSetUp) And (SKU <> Empty) ? pokud nalezne tak vyfiltruje cely radek z PL do makro workbooku ale ne pomoci copy paste, nybrz jako odkaz z workbooku na PL, tim ze vlozi nejaky dynamicky utvareny string zacinajici rovnitkem ActiveCell.Offset(1, 0).Select SKU = ActiveCell.FormulaR1C1 SKU = SKUtoBeSetUp ? R = ActiveCell.Row nebudeme kopirovat cely aktivni radek najednou z PL do workbooku Range(R & ":" & R).Copy ale zaplnime workbook postupne odkazy na PL bunky Windows(C_myMacroFile).Activate w = w + 1 Sheets(C_myMacroSheet).Range("A15").Select ActiveCell.Offset(w, 0).Select myCellAdd = ArrOfRQSkuCELL(w - 1) For pozice = 1 To ColQuant Step 1 Range("A2").Select y = y + 1 ActiveCell.Offset(y, 0).Select SKUtoBeSetUp = ActiveCell.FormulaR1C1 ColNo = ActiveCell.Column Header = ArrHeaders(pozice - 1) jestlize je "Date" v headeru pak Format bude datum InStr(1, Header, "Date") <> 0 ? pozice < 27 ? Selection.NumberFormat = "mm/dd/yy" InStr(1, Header, C_UPC) <> 0 ? Selection.NumberFormat = "0" need to be Formated as general (not specified), otherwise Selection.NumberFormat = "GENERAL" Formulae End up as text ColNo >= ColNoSku ? ColLetter = Mid(ActiveCell.Address, 2, 1) pro pripad $F$1 a nize budeme operovat s promennou SKUColLetter, tj pismeno sloupce teoreticky pro $AA$1 ColLetter = Mid(ActiveCell.Address, 2, 2) ActiveCell.Offset(0, 1).Select ColNo = ColNoSku ? myCellAdd = SKUColLetter & "$" & R SKUColLetter = ColLetter vlookupPAR3 = ColNo - ColNoSku + 1 cellTEXT = "=vlookup(" & myCellAdd & "," & uv & "[" & Qfile & "]" & PLtab & uv & "!" & SKUColLetter & ":" & ColLetter & "," & vlookupPAR3 & ",0)" ActiveCell.Value = cellTEXT Duv = Chr$(34) cellTEXT = "=INDIRECT(CONCATENATE(" & Duv & uv & "[" & Qfile & "]" & PLtab & uv & "!" & Duv & ", ADDRESS(MATCH(" & myCellAdd & "," & uv & "[" & Qfile & "]" & PLtab & uv & "!" & SKUColLetter & ":" & SKUColLetter & ",0), MATCH(" & Duv & Header & Duv & "," & uv & "[" & Qfile & "]" & PLtab & uv & "!$A$1:$" & ArrVirtualColumnLetters(ColQuant - 1) & "$1,0))))" ActiveCell.Value = cellTEXT Next pozice Windows(C_myMacroFile).Activate Range("A2").Select y = y + 1 ActiveCell.Offset(y, 0).Select SKUtoBeSetUp = ActiveCell.FormulaR1C1 !!! w = w + 1 notSetUpQuant = notSetUpQuant + 1 «2 ** 3 ** Yes No Yes No End For Yes No Yes No Yes No Yes No Yes No
  • 13. Select Case kategorie Warranty decision block *********************** "Input_Devices-Game_ Controller" ? "Input_Devices-Keyboards" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Kristi Baso" "Input_Devices-Mice" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Kristi Baso" "Web Cams" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Kristi Baso" "Input_Devices -Notebook_Mice" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Kristi Baso" "Accessories" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Katie Penza" "XBOX_Console" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "David Arndt" "PC_SW_non-VG" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "David Arndt" "VG_PC_SW" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Huan Nguyen" "XBOX_SW" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Ed Hewitt" "Zune" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Jenna Susko" "Zune_Accessories" ? .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Tom Kluis" .getElementById("_ 215127057_0_426000597_0_ 351613033_0").Value = "Charles Murray" .getElementById("_ 215127057_0_263500921_0_ 318388927_0") .selectedIndex = 2 InStr(1, kategorie, "SW") <> 0 ? ** Sample Sent days Warranty Labour Days/Years .getElementById("_ 215127057_0_263500921_0_ 1935191691_0").Value = 90 days Warranty Parts Days/Years .getElementById("_ 215127057_0_263500921_0_ 434903867_0").Value = 90 years .getElementById("_ 215127057_0_263500921_0_ 158089848_0").Value = 3 years .getElementById("_ 215127057_0_263500921_0_ 577627864_0").Value = 3 .all.Item("_215127057_0_ 224502806_0_1599375785_ 0").selectedIndex = 1 ******* SAVE GENERAL ********************** .all.Item("PC_7_0_J3_SAVE").Click Call is_busy(IE) ********* SUPPLIER TAB ************************* ************************ .getElementById("tab2").Click Call is_busy(IE) ** determining MSFT Xbox or Microsoft algorithm (from the file name) InStr(1, C_myMacroFile, "XBox") <> 0 ? Private Label Indicator = No .all.Item("_1552681051_0_ 1865545603_0_326364010_ 0").Value = "Microsoft Xbox Corporation" .all.Item("_1552681051_0_ 1865545603_0_326364010_ 0").Value = "Microsoft" .all.Item("_1552681051_0_ 2143843476_0_198836717_ 0").selectedIndex = 1 Primary Origin Country Indicator = Yes --- BY DEFAULT IE.document.all.Item("_1552681051_0_1053610938_0_259351390_0").selectedIndex = 2 Country of Origin for BBY Purchase = United States --- BY DEFAULT IE.document.all.Item("_1552681051_0_1053610938_0_190972293_0").value = United States For j = 0 To ColQuant - 1 ******* SAVE SUPPLIER TAB **************** ArrHeaders(j) = C_NetPrice ? Unit Cost .getElementById("_ 1552681051_0_1053610938_ 0_1408138848_0_ 1499822074_0").Value = MatrixPLfltrd(i, j) Next j .all.Item("PC_7_0_J3_SAVE").Click Call is_busy(IE) ********* LOGISTICS TAB ************************* ************************ .getElementById("tab3").Click Call is_busy(IE) »9 ** 7 ** Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes No End For Yes No
  • 14. Select Case ArrHeaders(j) C_ItemName ? C_PartNumber ? Best Buy Description .getElementById("_ 215127057_0_1352413751_0_ 1366209486_0").Value = MatrixPLfltrd(i, j) Description sign .getElementById("_ 215127057_0_1352413751_0_ 334658439_0").Value = MatrixPLfltrd(i, j) C_UPC ? Model or Selection .getElementById("_215127057_0_1742083922_0_233841037_0").Value = MatrixPLfltrd(i, j) current_SKU = MatrixPLfltrd(i, j) ReDim Preserve get_arr_of_set_up_SKU(i - 1) get_arr_of_set_up_SKU(i - 1) = current_SKU Item comments .getElementById("_215127057_0_426000597_0_1141097592_0").Value = "New Item Setup For " & MatrixPLfltrd(i, j) C_MSRP ? UPC type .all.Item("_215127057_0_ 1742083922_0_27072232_0_ 2126757239_0") .selectedIndex = 3 UPC .getElementById("_215127057_0_1742083922_0_27072232_0_768654447_0").Value = MatrixPLfltrd(i, j) ReDim Preserve get_arr_of_UPC(i - 1) get_arr_of_UPC(i - 1) = MatrixPLfltrd(i, j) Else Suggested retail .getElementById("_ 215127057_0_249243837_0_ 2086194608_0_1833282399_ 0").Value = MatrixPLfltrd(i, j) Next j «6 ** 8 ** Yes Yes Yes Yes
  • 15. ** Unit Dimensions and Weight ******************* a. Length or Depth = MS Unit Width b. Width = MS Unit Depth c. Height = MS Unit Length d. Dimensions UOM = IN (choose from the drop down) e. Weight = MS Unit Weight f. Weight UOM = LB (choose from the drop down) For j = 0 To ColQuant - 1 UOM - IN or LB For unit and MP Select Case ArrHeaders(j) C_Un_Width ? C_Un_Depth ? For iii = 0 To 2 .getElementById("_ 1715640154_0_553772606_" & iii & "_1269885005_0") .Value = MatrixPLfltrd(i, j) Next iii C_Un_Length ? For iii = 0 To 2 .getElementById("_ 1715640154_0_553772606_" & iii & "_267338521_0") .Value = MatrixPLfltrd(i, j) Next iii C_Un_Weight ? For iii = 0 To 2 .getElementById("_ 1715640154_0_553772606_" & iii & "_735435212_0") .Value = MatrixPLfltrd(i, j) Next iii Else For iii = 0 To 2 .getElementById("_ 1715640154_0_553772606_" & iii & "_305997947_0") .Value = MatrixPLfltrd(i, j) Next iii Next j For iii = 0 To 3 ** Master Pak Dimensions and Weight *********** .all.Item("_1715640154_0_553772606_" & iii & "_354836947_0").selectedIndex = 3 .all.Item("_1715640154_0_553772606_" & iii & "_434201048_0").selectedIndex = 3 Next iii For j = 0 To ColQuant - 1 ****** Inner, MPQ, TI, HI, IND **************************** Inner Pack - Number of Eaches = Always 1 Select Case ArrHeaders(j) C_MP_Length ? C_MP_Depth ? .getElementById("_ 1715640154_0_553772606_3_ 1269885005_0").Value = MatrixPLfltrd(i, j) C_MP_Width ? .getElementById("_ 1715640154_0_553772606_3_ 267338521_0").Value = MatrixPLfltrd(i, j) C_MP_Weight ? .getElementById("_ 1715640154_0_553772606_3_ 735435212_0").Value = MatrixPLfltrd(i, j) .getElementById("_ 1715640154_0_553772606_3_ 305997947_0").Value = MatrixPLfltrd(i, j) Next j .getElementById("_ 1715640154_0_662665405_0_ 1898596981_0").Value = 1 For j = 0 To ColQuant - 1 Call pvtus_SQL_dotaz(TI, HI, current_SKU) .getElementById("_1715640154_0_662665405_0_1795435815_0").Value = TI .getElementById("_1715640154_0_662665405_0_1163388972_0").Value = HI Case Pack - Number of Eaches = Masterpack Qty ArrHeaders(j) = C_MPQ ? Pallet - Number of Eaches .getElementById("_ 1715640154_0_662665405_0_ 1429791177_0").Value = MatrixPLfltrd(i, j) ArrHeaders(j) = C_PalletQuantity ? .getElementById("_ 1715640154_0_662665405_0_ 400926649_0").Value = MatrixPLfltrd(i, j) Next j One Way Ind = NO --- BY DEFAULT in HTML BBY Direct Import Ind = No .all.Item("_1715640154_0_ 81096678_0_552511319_0") .selectedIndex = 1 ******* SAVE Logistics Tab *************** .all.Item("PC_7_0_J3_SAVE").Click Call is_busy(IE) ********* DATES TAB ************************* ************************ .getElementById("tab4").Click Call is_busy(IE) »10 ** 9 ** End For Yes Yes End For Yes End For Yes End For End For End For End For Yes Yes Yes Yes Else End For Yes No Yes No
  • 16. the VBA code cannot see the ID in HTML, so we will use getElementsByTagName("input") the indexed order of the input element is 108, starting from 0 slashQ = 0 MM = "" DD = "" YY = "" nechceme Format(Time, "hh:mm:ss AMPM") MyTime = Format(Time, "hh:mm:ss") MyTime = Mid(MyTime, 1, 8) v pripade, ze by to bylo deklarovano: Dim MyTime As Date, pak implicitne pridava AM/PM nezavisle na Formatu, proto je to Dimenzovano MyTime As String For j = 0 To ColQuant - 1 BBuy_win = FindWindow(ByVal vbNullString, ByVal "Best Buy PIM Portal - Windows Internet Explorer") Call SetFocusAPI(ByVal BBuy_win) ArrHeaders(j) = C_MSD ? Len(MatrixPLfltrd(i, j)) <> 0 ? For iii = 1 To Len(MatrixPLfltrd(i, j)) Len(MM) = 1 ? Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 0 ? Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 1 ? MM = MM + Mid(MatrixPLfltrd(i, j), iii, 1) Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 2 ? DD = DD + Mid(MatrixPLfltrd(i, j), iii, 1) Mid(MatrixPLfltrd(i, j), iii, 1) = "/" ? YY = YY + Mid(MatrixPLfltrd(i, j), iii, 1) slashQ = slashQ + 1 Next iii Len(DD) = 1 ? MM = "0" + MM .getElementsByTagName("Form")(0).getElementsByTagName ("input")(108).Value = YY & "-" & MM & "-" & DD & " " & MyTime DD = "0" + DD Next j For j = 1 To 300 ******* SAVE Dates Tab ******************* Call PostMessage(ByVal BBuy_win, ByVal WM_KEYDOWN, ByVal VK_TAB, ByVal 0&) Call PostMessage(ByVal BBuy_win, ByVal WM_KEYUP, ByVal VK_TAB, ByVal 0&) ms Sleep 100 Next j .all.Item("PC_7_0_J3_SAVE").Click Call is_busy(IE) ********* Category TAB ************************* ************************ .getElementById("tab5").Click Call is_busy(IE) values of category attributes are stored in the MarketingMatrix - without a header go through the array ArrMarketDataHeaders and find the header and his position - index and then refer to the relevant index of the column in the MarketingMatrix k = 0 Do While ArrMarketDataHeaders(k) <> "Operating system" k = k + 1 Loop IE.document.all.Item("_1562711832_0").selectedIndex = MarketingMatrix(0, k) Select Case kategorie Case "PC_SW_non-VG" Case "VG_PC_SW" Case "Zune" Case "Accessories" 'XBOX Case "XBOX_Console" Case "XBOX_SW" Case "Input_Devices-Game_Controller" Case "Input_Devices-Mice" Case "Input_Devices-Keyboards" Case "Web Cams" End Select first - we determine indices of some repeating attributes to abbreviate the VBA code vista(0) = "Bus" vista(1) = "Basic" vista(2) = "Prem" vista(3) = "Ultim" indx_vista = 0 determining of operating system k = 0 ArrMarketDataHeaders(k) <> "Operating system" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 CPU_min(0) = 0# CPU_min(1) = 1# CPU_min(2) = 1.5 CPU_min(3) = 1.8 CPU_min(4) = 1.9 CPU_min(5) = 2# CPU_min(6) = 2.5 CPU_min(7) = 3# CPU_min(8) = 300# CPU_min(9) = 400# CPU_min(10) = 500# CPU_min(11) = 600# CPU_min(12) = 700# CPU_min(13) = 800# CPU_min(14) = 900# CPU_min(15) = 1200# "" ? "Vista" ? Not Applicable index_OS = 6 Else jen pripad pro rozrazeni verzi Visty For j = 7 To 13 Step 2 InStr(1, MarketingMatrix(i - 1, k), vista(indx_vista)) ? indx_vista = indx_vista + 1 index_OS = j InStr(1, MarketingMatrix(i - 1, k), "64") ? index_OS = j + 1 Next j the rest is a combination of Vista/XP -> prioritize XP (lower version) and for 95, 98 etc. neberu v bunce ohled. InStr(1, MarketingMatrix(i - 1, k), "XP") ? index_OS = 16 if we do not have XP in the offer, then select Windows generally index_OS = 15 CPU_min(16) = 1800# CPU_rcmd(0) = 0# CPU_rcmd(1) = 1# CPU_rcmd(2) = 1.5 CPU_rcmd(3) = 2# CPU_rcmd(4) = 2.5 CPU_rcmd(5) = 3# CPU_rcmd(6) = 300# CPU_rcmd(7) = 400# CPU_rcmd(8) = 500# CPU_rcmd(9) = 600# CPU_rcmd(10) = 700# CPU_rcmd(11) = 800# CPU_rcmd(12) = 900# CPU_rcmd(13) = 2500# determining a minimum frequency k = 0 ArrMarketDataHeaders(k) <> "Min Required CPU Speed" ? For j = 0 To 15 k = k + 1 Val(MarketingMatrix(i - 1, k)) > CPU_min(UBound(CPU_min)) ? Val(MarketingMatrix(i - 1, k)) > CPU_min(j) And Val(MarketingMatrix(i - 1, k)) <= CPU_min(j +1) ? index_CPU_min = j + 2 Next j DETERMINACE UOM - UNIT OF MEASURE index_CPU_min = UBound(CPU_min) + 1 k = 0 ArrMarketDataHeaders(k) <> "CPU Speed UOM" ? »13 »12 ** 10 ** ** 11 ** End For Yes No Yes No End For Yes No Yes No Yes No Yes No Yes No Yes No End For Yes No Yes Yes End For Yes No Yes No Yes No Yes No End For Yes No Yes No Yes No
  • 17. MarketingMatrix(i - 1, k) = "GHz" ? determining of a recommended frequency index_UOM_min = 1 index_UOM_min = 2 k = 0 ArrMarketDataHeaders(k) <> "Rcmded CPU Speed" ? For j = 0 To 12 k = k + 1 Val(MarketingMatrix(i - 1, k)) > CPU_rcmd(UBound (CPU_rcmd)) ? Val(MarketingMatrix(i - 1, k)) > CPU_rcmd(j) And Val(MarketingMatrix(i - 1, k)) <= CPU_rcmd(j+ 1) ? index_CPU_rcm = j + 2 Next j determining of UOM for RCMDED CPU SPEED index_CPU_rcm = UBound(CPU_rcmd) + 1 k = 0 ArrMarketDataHeaders(k) <> "Rcmded CPU Speed UOM" ? MarketingMatrix(i - 1, k) = "GHz" ? k = k + 1 determining a genre index_UOM_rcm = 1 index_UOM_rcm = 2 k = 0 ArrMarketDataHeaders(k) <> "Genre" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 determining a rating "Action" ? "Adult" ? index_genre = 1 "Adventure" ? index_genre = 2 "DEVELOPMENT TOOLS" ? index_genre = 3 "Educational" ? index_genre = 4 "Emulators" ? index_genre = 5 "Family Entertainment" ? index_genre = 6 "Fighting" ? index_genre = 7 "Home" ? index_genre = 8 "Music" ? index_genre = 9 "Other" ? index_genre = 10 "Puzzle" ? index_genre = 11 "Racing" ? index_genre = 12 "Reference" ? index_genre = 13 "RPG" ? index_genre = 14 "action RPG" ? index_genre = 15 "tactical action games, shooter" ? index_genre = 15 "shooter" ? index_genre = 16 "Simulation" ? index_genre = 16 "Sports" ? index_genre = 17 "Strategy" ? index_genre = 18 "Real Time Strategy" ? index_genre = 19 "Traditional" ? index_genre = 19 "Utility" ? index_genre = 20 "Variety" ? index_genre = 21 "WRESTLING" ? index_genre = 22 index_genre = 23 k = 0 ArrMarketDataHeaders(k) <> "Rating" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 determining a primary color "AO" ? "E" ? index_rating = 1 "Everyone 10+" ? index_rating = 2 "EC" ? index_rating = 3 "Mature M17+" ? index_rating = 4 "NOT_RATED" ? index_rating = 7 "RATING_PENDING" ? index_rating = 9 "Teen" ? index_rating = 13 "UN_RATED" ? index_rating = 15 "X_RATED" ? index_rating = 16 index_rating = 17 k = 0 ArrMarketDataHeaders(k) <> "Primary Color" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 determining a secondary color "Assorted" ? "Bisque" ? index_prim = 1 "Black" ? index_prim = 2 "Blue" ? index_prim = 3 "Bronze" ? index_prim = 4 "Brown" ? index_prim = 5 "Burgundy" ? index_prim = 6 "Camel" ? index_prim = 7 "Carbon Fiber" ? index_prim = 8 "Champagne" ? index_prim = 9 "Charcoal Grey" ? index_prim = 10 "Cherry" ? index_prim = 11 "Clear" ? index_prim = 12 "Cosmopolitan" ? index_prim = 13 "Cream" ? index_prim = 14 "Cyan" ? index_prim = 15 "Dove" ? index_prim = 16 "Espresso" ? index_prim = 17 "Gold" ? index_prim = 18 "Granite" ? index_prim = 19 "Green" ? index_prim = 20 "Grey" ? index_prim = 21 "Indigo" ? index_prim = 22 "Ivory" ? index_prim = 23 "Khaki" ? index_prim = 24 "Lavender" ? index_prim = 25 "Light Blue" ? index_prim = 26 "Light Green" ? index_prim = 27 "Light Purple" ? index_prim = 28 "Magenta" ? index_prim = 29 "Maple" ? index_prim = 30 "Mossy Oak Camo" ? index_prim = 31 "Natural Silver" ? index_prim = 32 "Navy" ? index_prim = 33 "Not Applicable" ? index_prim = 34 "Oak" ? index_prim = 35 "Off White" ? index_prim = 36 "Olive" ? index_prim = 37 "Orange" ? index_prim = 38 "Piano Black" ? index_prim = 39 "Pink" ? index_prim = 40 "Platinum" ? index_prim = 41 "Purple" ? index_prim = 42 "Red" ? index_prim = 43 "Rose" ? index_prim = 44 "Sangria" ? index_prim = 45 "Sapphire" ? index_prim = 46 "Silver" ? index_prim = 47 "Spice" ? index_prim = 48 "Stainless" ? index_prim = 49 "Titanium" ? index_prim = 50 "White" ? index_prim = 51 "Yellow" ? index_prim = 52 index_prim = 53 k = 0 ArrMarketDataHeaders(k) <> "Secondary Color" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 »14 ** 12 ** Yes No Yes No End For Yes No Yes No Yes No Yes No Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No
  • 18. k = k + 1 «11 ** 13 **
  • 19. determining of a type of a controller "Bisque" ? "Black" ? index_sec = 1 "Blue" ? index_sec = 2 "Brown" ? index_sec = 3 "Cherry" ? index_sec = 4 "Clear" ? index_sec = 5 "Cream" ? index_sec = 6 "Cyan" ? index_sec = 7 "Espresso" ? index_sec = 8 "Gold" ? index_sec = 9 "Green" ? index_sec = 10 "Grey" ? index_sec = 11 "Ivory" ? index_sec = 12 "Khaki" ? index_sec = 13 "Light Blue" ? index_sec = 14 "Light Green" ? index_sec = 15 "Light Purple" ? index_sec = 16 "Magenta" ? index_sec = 17 "Maple" ? index_sec = 18 "Mossy Oak Camo" ? index_sec = 19 "Natural Silver" ? index_sec = 20 "Navy" ? index_sec = 21 "Not Applicable" ? index_sec = 22 "Oak" ? index_sec = 23 "Off White" ? index_sec = 24 "Orange" ? index_sec = 25 "Pink" ? index_sec = 26 "Platinum" ? index_sec = 27 "Purple" ? index_sec = 28 "Red" ? index_sec = 29 "Silver" ? index_sec = 30 "Stainless" ? index_sec = 31 "Titanium" ? index_sec = 32 "White" ? index_sec = 33 "Yellow" ? index_sec = 34 index_sec = 35 k = 0 »15 ** 14 ** Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else
  • 20. ArrMarketDataHeaders(k) <> "Controller Type" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 determining of a type of a periphery gaming device "Dance Pad" ? "Not Applicable" ? index_cntrl = 1 "Remote" ? index_cntrl = 2 "Wheel" ? index_cntrl = 3 "Wired" ? index_cntrl = 4 "Wireless" ? index_cntrl = 5 index_cntrl = 6 k = 0 ArrMarketDataHeaders(k) <> "Gaming Peripheral Type" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 Select Case kategorie "Bundle" ? "Cable" ? index_peri = 1 "Care" ? index_peri = 2 "Case" ? index_peri = 3 "Cheat" ? index_peri = 4 "Control" ? index_peri = 5 "Customization" ? index_peri = 6 "Memory" ? index_peri = 7 "Multimedia" ? index_peri = 8 "Networking" ? index_peri = 9 "Not Applicable" ? index_peri = 10 "Power" ? index_peri = 11 "Sound" ? index_peri = 12 index_peri = 13 kategorie "PC_SW_non-VG" ? "VG_PC_SW" ? Operating system: Not Applicable, Vista Business, Vista Business 64-Bit, Vista Home Basic, Vista Home Basic 64-Bit, Vista Home Premium, Vista Home Premium 64-Bit, Vista Ultimate, Vista Ultimate 64-Bit, Windows, XP .all.Item("_1562711832_ 0").selectedIndex = index_OS Minimum Required Processor Speed: 0.0, 1.0, 1.5, 1.8, 1.9, 2.0, 2.5, 3.0, 300.0, 400.0 500.0, 600.0, 700.0, 800.0, 900.0, 1200.0, 1800.0 .all.Item("_181242228_0") .selectedIndex = index_CPU_min Minimum Required Processor Speed UOM: GHz, MHz .all.Item("_1834189895_ 0").selectedIndex = index_UOM_min 800 Recommended Processor Speed: 0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 300.0, 400.0, 500.0, 600.0, 700.0, .0, 900.0, 2500.0 .all.Item("_1315705878_0").selectedIndex = index_CPU_rcm Recommended Processor Speed UOM: GHz, MHz .all.Item("_1399342147_ 0").selectedIndex = index_UOM_rcm "Zune" ? always Game PlatForm: XBOX_360, (Xbox was discontinued in late 2006) .all.Item("_366871758_0") .selectedIndex = 13 Genre: ACTION, ADULT, ADVENTURE, EDUCATIONAL, EMULATORS, FAMILY, ENTERTAINMENT, FIGHTING, MUSIC, HOME, OTHER, PUZZLE, RACING, REFERENCE, ROLE_PLAYING, SHOOTER, SIMULATION, SPORTS, STRATEGY, TRADITIONAL, UTILITY, VARIETY, WRESTLING, DEVELOPMENT TOOLS .all.Item("_127407284_0") .selectedIndex = index_genre Rating: AO, E, E10+, EC, G, INHALANT, M, NC_17, NOT_RATED, PG, PG_13, R, RATING_PENDING, RP, T, UN_RATED, X_RATED .all.Item("_33944436_0") .selectedIndex = index_rating Street Date: k = 0 ArrMarketDataHeaders(k) <> "street date" ? street date must be in this formate> YYYY-MM-DD hh:mm:ss k = k + 1 street_date = MarketingMatrix(i - 1, k) If not street dated Then fill in MSD street_date = "" ? BBuy_win = FindWindow(ByVal vbNullString, ByVal "Best Buy PIM Portal - Windows InternetExplorer") Call SetFocusAPI(ByVal BBuy_win) slashQ = 0 MM = "" DD = "" YY = "" MyTime = Format(Time, "hh:mm:ss") For j = 0 To ColQuant - 1 ArrHeaders(j) = C_MSD ? Len(MatrixPLfltrd(i, j)) <> 0 ? For iii = 1 To Len(MatrixPLfltrd(i, j)) Len(MM) = 1 ? Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 0 ? Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 1 ? MM = MM + Mid(MatrixPLfltrd(i, j), iii, 1) Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 2 ? DD = DD + Mid(MatrixPLfltrd(i, j), iii, 1) Mid(MatrixPLfltrd(i, j), iii, 1) = "/" ? YY = YY + Mid(MatrixPLfltrd(i, j), iii, 1) slashQ = slashQ + 1 Next iii Len(DD) = 1 ? MM = "0" + MM .getElementsByTagName ("Form")(0) .getElementsByTagName ("input")(116).Value = YY & "-"& MM & "-" & DD & " " & MyTime DD = "0" + DD Next j .getElementsByTagName ("Form")(0) .getElementsByTagName ("input")(116).Value = street_date & " "& MyTime For j = 1 To 300 Minimum Required Processor Speed: 0.0, 1.0, 1.5, 1.8, 1.9, 2.0, 2.5, 3.0, 300.0, 400.0 500.0, 600.0, 700.0, 800.0, 900.0, 1200.0, 1800.0 Call PostMessage(ByVal BBuy_win, ByVal WM_KEYDOWN, ByVal VK_TAB, ByVal 0&) Call PostMessage(ByVal BBuy_win, ByVal WM_KEYUP, ByVal VK_TAB, ByVal 0&) ms Sleep 100 Next j .all.Item("_1395721575_ 0").selectedIndex = index_CPU_min Minimum Required Processor Speed UOM: GHz, MHz .all.Item("_1631443692_ 0").selectedIndex = index_UOM_min Recommended Processor Speed: 0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 900.0, 2500.0 .all.Item("_1312790437_ 0").selectedIndex = index_CPU_rcm Recommended Processor Speed UOM: GHz, MHz .all.Item("_1874924024_ 0").selectedIndex = index_UOM_rcm Number of Discs: 1 .getElementById("_ 876150083_0").Value = 1 "Accessories" ? CE and Accessory Primary Color .all.Item("_268021381_0") .selectedIndex = index_prim CE and Accessory Secondary Color .all.Item("_951516279_0") .selectedIndex = index_sec "XBOX_Console" ? XBOX Accessory Ind: None = 0, No = 1, Yes = 2 .all.Item("_1642772424_ 0").selectedIndex = 2 Controller Type: None, Dance Pad, Not Applicable, Remote, Wheel, Wired, Wireless .all.Item("_1690754485_ 0").selectedIndex = index_cntrl Gaming Peripheral Type: None, Bundle, Cable, Care, Case, Cheat, Control, Customization, Memory, Multimedia, Networking, Not Applicable, Power, Sound .all.Item("_569820874_0") .selectedIndex = index_peri "XBOX_SW" ? CE and Accessory Primary Color .all.Item("_400508731_0") .selectedIndex = index_prim CE and Accessory Secondary Color .all.Item("_1555794249_ 0").selectedIndex = index_sec "Input_Devices-Game_ Controller" ? Game PlatForm: XBOX_360, event. XBOX .all.Item("_67462387_0") .selectedIndex = 20 Genre: ACTION, ADULT, ADVENTURE, EDUCATIONAL, EMULATORS, FAMILY, ENTERTAINMENT, FIGHTING, MUSIC, HOME, OTHER, PUZZLE, RACING, REFERENCE, ROLE_PLAYING, SHOOTER, SIMULATION, SPORTS, STRATEGY, TRADITIONAL, UTILITY, VARIETY, WRESTLING, DEVELOPMENT TOOLS .all.Item("_373149557_0") .selectedIndex = index_genre Rating: AO, E, E10+, EC, G, INHALANT, M, NC_17, NOT_RATED, PG, PG_13, R, RATING_PENDING, RP, T, UN_RATED, X_RATED .all.Item("_1005868565_ 0").selectedIndex = index_rating Street Date: k = 0 ArrMarketDataHeaders(k) <> "street date" ? street date musi byt ve Formatu YYYY-MM-DD hh:mm:ss k = k + 1 street_date = MarketingMatrix(i - 1, k) If not street dated Then fill in MSD street_date = "" ? BBuy_win = FindWindow(ByVal vbNullString, ByVal "Best Buy PIM Portal - Windows InternetExplorer") Call SetFocusAPI(ByVal BBuy_win) slashQ = 0 MM = "" DD = "" YY = "" MyTime = Format(Time, "hh:mm:ss") For j = 0 To ColQuant - 1 ArrHeaders(j) = C_MSD ? Len(MatrixPLfltrd(i, j)) <> 0 ? For iii = 1 To Len(MatrixPLfltrd(i, j)) Len(MM) = 1 ? Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 0 ? Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 1 ? MM = MM + Mid(MatrixPLfltrd(i, j), iii, 1) Mid(MatrixPLfltrd(i, j), iii, 1) <> "/" And slashQ = 2 ? DD = DD + Mid(MatrixPLfltrd(i, j), iii, 1) Mid(MatrixPLfltrd(i, j), iii, 1) = "/" ? YY = YY + Mid(MatrixPLfltrd(i, j), iii, 1) slashQ = slashQ + 1 Next iii Len(DD) = 1 ? MM = "0" + MM .getElementsByTagName ("Form")(0) .getElementsByTagName ("input")(116).Value = YY & "-"& MM & "-" & DD & " " & MyTime DD = "0" + DD Next j .getElementsByTagName ("Form")(0) .getElementsByTagName ("input")(116).Value = street_date & " "& MyTime For j = 1 To 300 Number of Discs: 1 Call PostMessage(ByVal BBuy_win, ByVal WM_KEYDOWN, ByVal VK_TAB, ByVal 0&) Call PostMessage(ByVal BBuy_win, ByVal WM_KEYUP, ByVal VK_TAB, ByVal 0&) ms Sleep 100 Next j .getElementById("_ 92864450_0").Value = 1 "Input_Devices-Mice" ? Accessory Ind: None, No, Yes .all.Item("_648190504_0") .selectedIndex = 2 CE and Accessory Primary Color .all.Item("_456433945_0") .selectedIndex = index_prim CE and Accessory Secondary Color .all.Item("_1627363851_ 0").selectedIndex = index_sec Number of Buttons: None, 0, 1, 2, 3, 4, 5, 6 k = 0 ArrMarketDataHeaders(k) <> "Number of Buttons" ? Index = Val(MarketingMatrix(i - 1, k)) + 2 .all.Item("_187851846_0").selectedIndex = Index k = k + 1 "Input_Devices-Keyboards" ? CE and Accessory Primary Color .all.Item("_480222994_0") .selectedIndex = index_prim CE and Accessory Secondary Color .all.Item("_851789664_0") .selectedIndex = index_sec Number of Buttons: None, 0, 1, 2, 3, 4, 5, 6 k = 0 ArrMarketDataHeaders(k) <> "Number of Buttons" ? Index = Val(MarketingMatrix(i - 1, k)) + 2 .all.Item("_1331524015_0").selectedIndex = Index k = k + 1 Number of Programmable Buttons: None, 0, 1, 2, .... 12 k = 0 ArrMarketDataHeaders(k) <> "Number of Programmable Buttons" ? Index = Val(MarketingMatrix(i - 1, k)) + 2 .all.Item("_222122316_0").selectedIndex = Index k = k + 1 Tilt Wheel: None, No, Yes k = 0 ArrMarketDataHeaders(k) <> "Tilt Wheel" ? MarketingMatrix(i - 1, k) = "Yes" ? k = k + 1 Type of Pointing Device: None, Ball, Laser, Not Applicable, Optical, Presenter Mouse .all.Item("_1057497258_ 0").selectedIndex = 2 .all.Item("_1057497258_ 0").selectedIndex = 1 k = 0 ArrMarketDataHeaders(k) <> "Type of Pointing Device" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 .all.Item("_1914843709_ 0").selectedIndex = Index "Ball" ? "Bluetrack" ? Index = 1 "Laser" ? Index = 2 "Not Applicable" ? Index = 3 "Optical" ? Index = 4 "Presenter Mouse" ? Index = 5 Index = 6 "Web Cams" ? Backlit Keys: None, No, Yes k = 0 ArrMarketDataHeaders(k) <> "Backlit Keys" ? MarketingMatrix(i - 1, k) = "Yes" ? k = k + 1 Battery Size: None, 9V, AA, AAA, C, D, Not Applicable, Photo, Specialty .all.Item("_1840074102_ 0").selectedIndex = 2 .all.Item("_1840074102_ 0").selectedIndex = 1 k = 0 ArrMarketDataHeaders(k) <> "Battery Size" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 .all.Item("_253158650_0") .selectedIndex = Index "9V" ? "AA" ? Index = 1 "AAA" ? Index = 2 "C" ? Index = 3 "D" ? Index = 4 "Not Applicable" ? Index = 5 "Photo" ? Index = 6 "Specialty" ? Index = 7 Index = 8 CE and Accessory Primary Color .all.Item("_834572842_0") .selectedIndex = index_prim CE and Accessory Secondary Color .all.Item("_2079577208_ 0").selectedIndex = index_sec Mouse Included: None, Ball, Built Into Keyboard, Laser, No, Optical, Scroller, Wireless, Wireless Laser, Wireless Optical, Wireless Scroller k = 0 ArrMarketDataHeaders(k) <> "Mouse Included" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 .all.Item("_417869597_0") .selectedIndex = Index "Ball" ? "Built Into Keyboard" ? Index = 1 "Laser" ? Index = 2 "No" ? Index = 3 "Optical" ? Index = 4 "Scroller" ? Index = 5 "Wireless" ? Index = 6 "Wireless Laser" ? Index = 7 "Wireless Optical" ? Index = 8 "Wireless Scroller" ? Index = 9 Index = 10 Multimedia Keys: None, No, Yes k = 0 ArrMarketDataHeaders(k) <> "Multimedia Keys" ? MarketingMatrix(i - 1, k) = "Yes" ? k = k + 1 Number of Keys: .all.Item("_279444067_0") .selectedIndex = 2 .all.Item("_279444067_0") .selectedIndex = 1 k = 0 ArrMarketDataHeaders(k) <> "Number of Keys" ? .getElementById("_ 2118570484_0").Value = MarketingMatrix(i - 1, k) k = k + 1 Number of USB Ports: None, 0, .. 10 k = 0 ArrMarketDataHeaders(k) <> "Number of USB Ports" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 .all.Item("_743999170_0") .selectedIndex = Index "0" ? "1" ? Index = 1 "2" ? Index = 2 "3" ? Index = 3 "4" ? Index = 4 "5" ? Index = 5 "6" ? Index = 6 "7" ? Index = 7 "8" ? Index = 8 "9" ? Index = 9 "10" ? Index = 10 Index = 11 Built In Microphone: None, No, Yes k = 0 ArrMarketDataHeaders(k) <> "Built In Microphone" ? MarketingMatrix(i - 1, k) = "Yes" ? k = k + 1 CE and Accessory Primary Color .all.Item("_947613075_0") .selectedIndex = 2 .all.Item("_947613075_0") .selectedIndex = 1 .all.Item("_1731412480_ 0").selectedIndex = index_prim CE and Accessory Secondary Color .all.Item("_654042830_0") .selectedIndex = index_sec Headphone Connection: None, Mini Stereo, Not Applicable, RCA, Wireless k = 0 ArrMarketDataHeaders(k) <> "Headphone Connection" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 .all.Item("_1239705568_ 0").selectedIndex = Index "Mini Stereo" ? "Not Applicable" ? Index = 1 "RCA" ? Index = 2 "Wireless" ? Index = 3 Index = 4 Headset Included: None, No, Yes k = 0 ArrMarketDataHeaders(k) <> "Headset Included" ? MarketingMatrix(i - 1, k) = "Yes" ? k = k + 1 Software Included: None, Data Recovery Software, Educational Software, Facial Recognition Software, Music Management Software, Navigation Software, Not Applicable, Photo Editing Software, Video Effects Software .all.Item("_1627316746_ 0").selectedIndex = 2 .all.Item("_1627316746_ 0").selectedIndex = 1 k = 0 ArrMarketDataHeaders(k) <> "Software Included" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 .all.Item("_1579521051_ 0").selectedIndex = Index "Data Recovery Software" ? "Educational Software" ? Index = 1 "Facial Recognition Software" ? Index = 2 "Music Management Software" ? Index = 3 "Navigation Software" ? Index = 4 "Not Applicable" ? Index = 5 "Photo Editing Software" ? Index = 6 "Video Effects Software" ? Index = 7 Index = 8 Webcam Design: None, Desktop, Laptop, Not Applicable k = 0 ArrMarketDataHeaders(k) <> "Webcam Design" ? Select Case MarketingMatrix(i - 1, k) k = k + 1 .all.Item("_1402083757_ 0").selectedIndex = Index "Desktop" ? "Laptop" ? Index = 1 "Not Applicable" ? Index = 2 Index = 3 Application.Wait (Now + TimeValue("0:00:3")) .all.Item("PC_7_0_J3_SAVE").Click Call is_busy(IE) End With j = 0 ReDim Preserve PIMId(i - 1) IE.Document.all.tags ("td")(j).innerTEXT <> "PIM Id" ? IE.navigate "https://pimportal.bestbuy.com/wps/myportal/!ut/p/kcxml /04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4h39gDJgFjGpvqRqCKOcIEg fW99X4_83FT9AP2C3NCIckdHRQBrdSb8/delta/base64xml/L3dJdyEvd0ZNQUFzQUMvNElVRS82XzBfQ0g!" PIMId(i - 1) = IE.Document.all.tags("td")(j + 1).innerTEXT j = j + 1 PIMId(i - 1) = "PIM Id" ? PIMId(i - 1) = IE.Document.all.tags ("td")(j + 1).innerTEXT PIM Id ma 10 cifer, zacina mezerou PIMId(i - 1) = Mid(PIMId(i - 1), 2, 10) 1946 Call is_busy(IE) done_1 = True setup the Next SKU Next i «5 ** 15 ** Yes No Yes Yes Yes Yes Yes Yes Else Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes Yes Yes Yes No Yes No End For Yes No Yes No End For Yes No Yes No Yes No Yes No Yes No Yes No End For Yes Yes Yes Yes Yes No Yes No End For Yes No Yes No End For Yes No Yes No Yes No Yes No Yes No Yes No End For Yes Yes No Yes Yes No Yes No Yes No Yes No Yes No Yes Yes Yes Yes Yes Yes Else Else Yes Yes No Yes No Yes No Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes No Yes No Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes No Yes No Yes Yes Yes Yes Else Yes No Yes No Yes No Yes Yes Yes Yes Yes Yes Yes Yes Else Yes No Yes Yes Yes Else Yes No Yes No