Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing data from Excel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01127310
Message ID:
01127522
Vues:
9
Whew! That's a lot of code. I guess my needs are not as detailed. I did end up using automation and the code is below. I got the dates ok via automation, but realized I didn't need to because they just had the date field set up so that it would always display the current date, so there was no point in retrieving it. I didn't have any problems with truncation when using automation, so I'm not sure what might be going on there.

Thanks for everyone's help.
.oExcel = createobject("Excel.Application")
oFile   = .oExcel.Workbooks.Open(.FileName)

IF VARTYPE(oFile) = "O"

   .CustNo = TRANSFORM(.oExcel.Range("D6").value)
   .SaleId = .CustNo + "SP"

   RowNum = 17

   do while .t.
      
      m.Item = .oExcel.Range("C" + transform(RowNum)).value
				
      if empty(m.Item) or isnull(m.Item)
         exit
      endif

      m.Discount = ROUND(.oExcel.Range("H" + transform(RowNum)).value * 100, 2)
			
      INSERT INTO QuoteCursor;
         (item, NewDisc) VALUES (m.Item, m.Discount)

      RowNum = RowNum + 1

   enddo

endif
>Hi Russell,
>
>I'm working on the exactly same problem at the moment. I've modified my colleague's code and here's what I have right now.
>
>The problems, that I need to fix, may be you or someone can help:
>1) Date columns were not converted correctly
>2) Long info was truncated to ~10 chars.
eCost.com continues to rip people off
Check their rating at ResellerRatings.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform