Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
Highlighted
mihai_iov
Contributor II

VBScript: Get data from excel cell and load it into variable

I'm trying to get a value from a cell in Excel that I calculate with a formula and then load the said value into a variable, to be used further down into the macro.

I've tried with: set vAverage = XLDoc.Sheets(1).Range("B2").Value but I get an "Object required: 'XLDoc.Sheets(...).Range(...).Value' " error. Any help?

Tags (2)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: VBScript: Get data from excel cell and load it into variable

The cell-content isn't an object else just a value therefore try it with:

vAverage = XLDoc.Sheets(1).Range("B2").Value

- Marcus

3 Replies
MVP & Luminary
MVP & Luminary

Re: VBScript: Get data from excel cell and load it into variable

The cell-content isn't an object else just a value therefore try it with:

vAverage = XLDoc.Sheets(1).Range("B2").Value

- Marcus

mihai_iov
Contributor II

Re: VBScript: Get data from excel cell and load it into variable

That's it! Thanks!

NguyenLoc
New Contributor

Re: VBscript: Get data from excel cell and load it into variable

Please help me!

I'm having the same problem.

But I do not not how to replace the "XLDOC"

What is "XLDOC" here? Is this the path where the Excel file located?