View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Raul Sousa Raul Sousa is offline
external usenet poster
 
Posts: 17
Default variable not set

I have this code, I wrote.
I am not very confortable with VBA, so I have a problem.

When it arrives at the last line it gives an error. Run-time error, 91 :
€œvariable not set€.

I cant understand why.

Dim UlinDez, UlinMovOr, UlinCarOr, UlinMovFn, UlinCarFn As String
Dim wbDez As Workbook
Dim wbMov As Workbook
Dim WbCar As Workbook
Dim FicDez, FicMov, FicCar As String
Dim Emp, Mes As String

FicDez = Application.GetOpenFilename
FicMov = Application.GetOpenFilename
FicCar = Application.GetOpenFilename

Mes = Application.InputBox("Indicar o mês")

Workbooks.OpenText Filename:=FicDez _
, Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited,
Semicolon:=True, FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1),
Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1)), TrailingMinusNumbers:=True

wbDez = ActiveWorkbook.Name