Runtime error 91

John_B

New Member
Joined
Oct 1, 2014
Messages
7
Hello, When Ever I run my code I get the runtime '91': object variable or with block variable not set.

Any help?



Dim oXL As Excel.Application
Set oXL = CreateObject("Excel.Application")

oXL.Visible = True
oXL.VBE.ActiveVBProject.vbComponents.Import ("\\LG-NAS\Parallax")
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
you get this error because there are no workbooks in your oXL

Code:
Dim oXL As Excel.Application
Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
[COLOR=#ff0000][B]oXL.Workbooks.Add[/B][/COLOR]
oXL.VBE.ActiveVBProject.VBComponents.Import "D:\ProjX\mProjx.bas"


Hello, When Ever I run my code I get the runtime '91': object variable or with block variable not set.

Any help?



Dim oXL As Excel.Application
Set oXL = CreateObject("Excel.Application")

oXL.Visible = True
oXL.VBE.ActiveVBProject.vbComponents.Import ("\\LG-NAS\Parallax")
 
Upvote 0

Forum statistics

Threads
1,222,786
Messages
6,168,220
Members
452,171
Latest member
saeid025

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top