![]() |
|
|
Thread Tools | Display Modes |
#2
|
||||
|
||||
![]()
Firstly when you declare variables you should explicitly define each variable's type
Dim pregunta, opA, opB, opC, opD, ans, respC, explRC, dif, ref, obj, topic, pclave, prof As String In the above declaration, only prof is a string. All the other variables are variants. It needs to be written as Dim pregunta as String, opA as String, opB as String Secondly, your code creates a document and then start looping through the rows and before you move to the next row, you close the document. This means on the second pass of the loop, the document is no longer open. Did you want one document per row or are you creating a single document containing all the row content?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
excel 2013, vba, word 2013 |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
reverse order of paragraphs, word 2010 | moorea21 | Word VBA | 1 | 08-02-2018 03:47 AM |
![]() |
Ivica | Word | 3 | 12-28-2015 01:31 PM |
![]() |
FromF | Excel | 2 | 09-09-2014 02:30 AM |
Office 2010 Excel Full pass | raineraus | Excel | 1 | 09-19-2012 12:55 PM |
![]() |
Coreysan | Mail Merge | 3 | 12-11-2011 04:22 PM |