Vlookup using VBA from excel to project - Urgent Help Needed

T

tmdrake

Hi,

I am trying to import data from excel to project 2007 using VBA: below in
the string I am using:

TempPercent = xlApp.ActiveWorkbook.Application.WorksheetFunction.VLookup _
(TaskName, Range("A4:D6"), 2, False) * 100

However, I keeping getting the following error: Runtime error: 1004 Unable
to get the Vlookup property of the worksheet function class.

Any help will be greatly appreicated
 
M

meg99

Hi,

I am trying to import data from excel to project 2007 using VBA:  belowin
the string I am using:

TempPercent = xlApp.ActiveWorkbook.Application.WorksheetFunction.VLookup _
 (TaskName, Range("A4:D6"), 2, False) * 100

However, I keeping getting the following error: Runtime error: 1004 Unable
to get the Vlookup property of the worksheet function class.

Any help will be greatly appreicated

tmdrake,
instead of using vlookup, i recommend you create an import map based
on the TaskName or some other unique number and open the import the
data directly from Excel.

meg99
 
R

Rod Gill

Hi,

xlApp should already be the Application object so
xlApp.WorksheetFunction.VLookup should work.

If not, you may need vlookup cells in the spreadsheet to create in advance
the data you want.

I assume TaskName is an Excel Range object? If not it probably needs to be.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com



Hi,

I am trying to import data from excel to project 2007 using VBA: below in
the string I am using:

TempPercent = xlApp.ActiveWorkbook.Application.WorksheetFunction.VLookup _
(TaskName, Range("A4:D6"), 2, False) * 100

However, I keeping getting the following error: Runtime error: 1004 Unable
to get the Vlookup property of the worksheet function class.

Any help will be greatly appreicated

tmdrake,
instead of using vlookup, i recommend you create an import map based
on the TaskName or some other unique number and open the import the
data directly from Excel.

meg99
 

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