Suggerimenti e richiesta
Hai un problema con Excel? 
Suggerimenti e richiesta
di Maury1704 (utente non iscritto) data: 15/04/2012
Salve mi chiamo maurizio ; e o un problema , con un mio progetto che all’origine l’ avevo costruito in visual basic 6.0 e devo dire che funziona benissimo ; ma convinto d’aver imparato molto nell’ambito della programmazione ad oggetti ; vorrei trasferire tutto cio’ anche in excel .
sino a qui tutto bene tranne che per un fatto strano che tutte le volte che incontra la parola “ line “ che tra’ le altre cose o pensato bene di evidenziare in questo mio messaggio ; il programma si ferma e mi da errore , che dice “ impossobile trovare il metodo o il membro dei dati “ perche’ ?.
eppure in visual basic funziona benissimo ! e’ anche vero che in visual basic o inserito una picturebox – e non un image 1 , pero’ penso che siano la stessa cosa no ? .
qualcuno di voi a un idea di come potrei risolvere questo inconvegnente !.
grazie a tutti coloro che vorranno aiutarmi . a. maurizio
#################################################
private sub setdaycell(dx as integer, dy as integer)
on error resume next
static prevdayx as integer, prevdayy as integer
dim nd as integer
nd = (dy - 1) * 7 + dx - iweekdayoffset
if dx <= 0 or dy <= 0 or dx > 7 or dy > 6 then
if dx = 0 and dy = 0 then
prevdayx = 0: prevdayy = 0
end if
exit sub
end if
if dx = prevdayx and dy = prevdayy then
exit sub
end if
if nd <= 0 or nd > imonthdays then
exit sub
end if
if prevdayx > 0 and prevdayy > 0 and prevdayx <= 7 and prevdayy <= 6 then
image1.line ((prevdayx - 1) * 2 + 1, (prevdayy - 1) * 2 + 1)-((prevdayx) * 2 + 1, (prevdayy) * 2 + 1), rgb(255, 255, 255), bf
image1.line ((prevdayx - 1) * 2 + 1, (prevdayy - 1) * 2 + 1)-((prevdayx) * 2 + 1, (prevdayy) * 2 + 1), rgb(0, 0, 0), b
image1.currentx = (prevdayx - 1) * 2 + 1
image1.currenty = (prevdayy - 1) * 2 + 1
image1.print (prevdayy - 1) * 7 + prevdayx - iweekdayoffset;
end if
image1.line ((dx - 1) * 2 + 1, (dy - 1) * 2 + 1)-(dx * 2 + 1, dy * 2 + 1), rgb(255, 0, 0), bf
image1.line ((dx - 1) * 2 + 1, (dy - 1) * 2 + 1)-(dx * 2 + 1, dy * 2 + 1), rgb(0, 0, 0), b
image1.currentx = (dx - 1) * 2 + 1
image1.currenty = (dy - 1) * 2 + 1
image1.print nd
prevdayx = dx: prevdayy = dy
end sub
#################################################
in piu' desidero sapere se' si potesse avere un listato anche solo sottoforma di bozza , ma che sia funzionante , per capire e riuscire a mettere in pratica il gioco di " forza quattro " sritto con il vba di excel ; o ancor meglio il gioco degli scacchi ; in quanto e sempre stato un mio sogno nel cassetto riuscire a realizzare tutto cio' ; ma che non sono mai riuscito a fare. grazie
Vuoi Approfondire?