Compile Error: Argument not optional

G

Guest

I am testing something because I am going to be programming the VBE behind
several workbooks. I was testing the following and I got the error
called..Compile Error: Argument not optional. Is there a reason why? Then
it focused on the .Export function.

Sub CopyOneModule()

Dim FName As String

With Workbooks("sirNAsequences7")
FName = .Path & "\code.txt"
.VBProject.VBComponents("Module1").Export
FName
End With
Workbooks("Changemodulecode").VBProject.VBComponents.Import
FName

End Sub
 
M

Mark Lincoln

I believe FName needs to be in parentheses after Export. Export
requires at minimum a valid filename.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top